Fixed Ricky's Room breaking when photos aren't available.

This commit is contained in:
DebaucheryLibrarian 2025-08-27 04:26:55 +02:00
parent 2885a82f8e
commit 4979e161ff
1 changed files with 4 additions and 2 deletions

View File

@ -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;