diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-06 19:44:38 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-06 19:44:38 -0400 |
commit | f25e61a530ea11925bb54cbd234003f2ff99b276 (patch) | |
tree | 8e42bd0f4637e7a9ab2c458d1ed1323fb79cc2ed /src | |
parent | 1b78a825e2c3f6a535497a64840fe88be23c44f1 (diff) |
thumbs: getExpectedImagePaths: cleanup + wallpaper parts preview
Diffstat (limited to 'src')
-rw-r--r-- | src/gen-thumbs.js | 25 |
1 files 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 |