From 481c9feada3c8193e487bc51cc41ab7cfb4e525e Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 28 Mar 2022 20:05:25 +0200 Subject: [PATCH] Fixed missing scenes photos breaking album. --- assets/components/releases/release.vue | 2 +- assets/js/curate.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/components/releases/release.vue b/assets/components/releases/release.vue index ff3a551e..17b73150 100644 --- a/assets/components/releases/release.vue +++ b/assets/components/releases/release.vue @@ -28,7 +28,7 @@ tag.tag || tag) : [], }; - if (release.scenes) curatedRelease.scenes = release.scenes.filter(Boolean).map(({ scene }) => curateRelease(scene, 'scene')); - if (release.movies) curatedRelease.movies = release.movies.filter(Boolean).map(({ movie }) => curateRelease(movie, 'movie')); - if (release.series) curatedRelease.series = release.series.filter(Boolean).map(({ serie }) => curateRelease(serie, 'serie')); - if (release.chapters) curatedRelease.chapters = release.chapters.filter(Boolean).map((chapter) => curateRelease(chapter)); - if (release.photos) curatedRelease.photos = release.photos.filter(Boolean).map((photo) => photo.media || photo); - if (release.scenesPhotos) curatedRelease.scenesPhotos = release.scenesPhotos.filter(Boolean).map((photo) => photo.media || photo); - if (release.covers) curatedRelease.covers = release.covers.filter(Boolean).map(({ media }) => media); + curatedRelease.scenes = release.scenes?.filter(Boolean).map(({ scene }) => curateRelease(scene, 'scene')) || []; + curatedRelease.movies = release.movies?.filter(Boolean).map(({ movie }) => curateRelease(movie, 'movie')) || []; + curatedRelease.series = release.series?.filter(Boolean).map(({ serie }) => curateRelease(serie, 'serie')) || []; + curatedRelease.chapters = release.chapters?.filter(Boolean).map((chapter) => curateRelease(chapter)) || []; + curatedRelease.photos = release.photos?.filter(Boolean).map((photo) => photo.media || photo) || []; + curatedRelease.scenesPhotos = release.scenesPhotos?.filter(Boolean).map((photo) => photo.media || photo) || []; + curatedRelease.covers = release.covers?.filter(Boolean).map(({ media }) => media) || []; if (release.trailer) curatedRelease.trailer = release.trailer.media; if (release.teaser) curatedRelease.teaser = release.teaser.media; if (release.actors) curatedRelease.actors = release.actors.filter(Boolean).map((actor) => curateActor(actor.actor || actor, curatedRelease));