From 4979e161ffc991397f8555bc8ff22a7e18910749 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 27 Aug 2025 04:26:55 +0200 Subject: [PATCH] Fixed Ricky's Room breaking when photos aren't available. --- src/scrapers/rickysroom.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scrapers/rickysroom.js b/src/scrapers/rickysroom.js index 6530cbaf..f3c81633 100755 --- a/src/scrapers/rickysroom.js +++ b/src/scrapers/rickysroom.js @@ -23,7 +23,7 @@ function scrapeScene(data, channel) { release.tags = data.tags; release.poster = [data.trailer_screencap].concat(data.extra_thumbnails); - release.photos = data.previews.full + release.photos = data.previews?.full .map((url) => [url, url.replace('full/', 'thumbs/')]) // photos .concat(data.thumbs); // screenshots @@ -69,7 +69,9 @@ async function fetchLatest(channel, page = 1) { const data = dataString && JSON.parse(dataString); if (data.props?.pageProps?.contents?.data) { - return data.props.pageProps.contents.data.map((scene) => scrapeScene(scene, channel)); + const scenes = data.props.pageProps.contents.data.map((scene) => scrapeScene(scene, channel)); + + return scenes; } return null;