Fixed Ricky's Room breaking when photos aren't available.
This commit is contained in:
parent
2885a82f8e
commit
4979e161ff
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue