From f95c80f73f361d237995b885a4015fe0fc9f0795 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 13 Jan 2021 01:10:29 +0100 Subject: [PATCH] Using poster photo for Pinky XXX. --- src/scrapers/pinkyxxx.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/scrapers/pinkyxxx.js b/src/scrapers/pinkyxxx.js index d0f4d1da..63577fb1 100644 --- a/src/scrapers/pinkyxxx.js +++ b/src/scrapers/pinkyxxx.js @@ -63,7 +63,7 @@ function scrapeAll(scenes) { }); } -async function scrapeScene({ query }, channel) { +async function scrapeScene({ query }, channel, baseScene) { const release = {}; release.title = query.cnt('.title'); @@ -73,7 +73,11 @@ async function scrapeScene({ query }, channel) { const { poster, trailer } = await getTrailer(release.entryId, channel) || {}; - release.poster = poster; + release.poster = baseScene?.poster || poster; + release.photos = poster && baseScene?.poster + ? [poster, ...baseScene.photos] + : baseScene?.photos; + release.trailer = trailer; return release; @@ -96,11 +100,11 @@ async function fetchLatest(channel, page) { return res.status; } -async function fetchScene(url, channel) { +async function fetchScene(url, channel, baseScene) { const res = await qu.get(url); if (res.ok) { - return scrapeScene(res.item, channel); + return scrapeScene(res.item, channel, baseScene); } return res.status;