From f25e61a530ea11925bb54cbd234003f2ff99b276 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 6 Jan 2025 19:44:38 -0400 Subject: thumbs: getExpectedImagePaths: cleanup + wallpaper parts --- src/gen-thumbs.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/gen-thumbs.js b/src/gen-thumbs.js index d08726c7..6c82761f 100644 --- a/src/gen-thumbs.js +++ b/src/gen-thumbs.js @@ -1264,11 +1264,28 @@ export function getExpectedImagePaths(mediaPath, {urls, wikiData}) { const paths = [ wikiData.albumData - .flatMap(album => [ - album.hasCoverArt && fromRoot.to('media.albumCover', album.directory, album.coverArtFileExtension), - !empty(CacheableObject.getUpdateValue(album, 'bannerArtistContribs')) && fromRoot.to('media.albumBanner', album.directory, album.bannerFileExtension), - !empty(CacheableObject.getUpdateValue(album, 'wallpaperArtistContribs')) && fromRoot.to('media.albumWallpaper', album.directory, album.wallpaperFileExtension), + .map(album => [ + album.hasCoverArt && [ + fromRoot.to('media.albumCover', album.directory, album.coverArtFileExtension), + ], + + !empty(CacheableObject.getUpdateValue(album, 'bannerArtistContribs')) && [ + fromRoot.to('media.albumBanner', album.directory, album.bannerFileExtension), + ], + + !empty(CacheableObject.getUpdateValue(album, 'wallpaperArtistContribs')) && + empty(album.wallpaperParts) && [ + fromRoot.to('media.albumWallpaper', album.directory, album.wallpaperFileExtension), + ], + + !empty(CacheableObject.getUpdateValue(album, 'wallpaperArtistContribs')) && + !empty(album.wallpaperParts) && + album.wallpaperParts.flatMap(part => [ + part.asset && + fromRoot.to('media.albumWallpaperPart', album.directory, part.asset), + ]), ]) + .flat(2) .filter(Boolean), wikiData.artistData -- cgit 1.3.0-6-gf8a5