From fb6e7816d1911e9e2b218939d2b5c7eef22ab552 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 13 Apr 2024 15:28:12 -0300 Subject: content: generate{Album,ArtTag,Artist}GalleryPage: rectangles --- src/content/dependencies/generateAlbumGalleryPage.js | 16 +++++++++++++++- src/content/dependencies/generateArtTagGalleryPage.js | 11 +++++++++-- src/content/dependencies/generateArtistGalleryPage.js | 11 +++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generateAlbumGalleryPage.js b/src/content/dependencies/generateAlbumGalleryPage.js index f61b1983..b4f9268c 100644 --- a/src/content/dependencies/generateAlbumGalleryPage.js +++ b/src/content/dependencies/generateAlbumGalleryPage.js @@ -145,6 +145,18 @@ export default { : null)), ]; + data.dimensions = [ + (album.hasCoverArt + ? album.coverArtDimensions + : null), + + ... + album.tracks.map(track => + (track.hasUniqueCoverArt + ? track.coverArtDimensions + : null)), + ]; + return data; }, @@ -175,10 +187,12 @@ export default { stitchArrays({ image: relations.images, path: data.paths, + dimensions: data.dimensions, name: data.names, - }).map(({image, path, name}) => + }).map(({image, path, dimensions, name}) => image.slots({ path, + dimensions, missingSourceContent: language.$('misc.albumGalleryGrid.noCoverArt', {name}), })), diff --git a/src/content/dependencies/generateArtTagGalleryPage.js b/src/content/dependencies/generateArtTagGalleryPage.js index 962f1b7f..338d18fe 100644 --- a/src/content/dependencies/generateArtTagGalleryPage.js +++ b/src/content/dependencies/generateArtTagGalleryPage.js @@ -74,6 +74,9 @@ export default { ? ['media.trackCover', thing.album.directory, thing.directory, thing.coverArtFileExtension] : ['media.albumCover', thing.directory, thing.coverArtFileExtension])); + data.dimensions = + query.things.map(thing => thing.coverArtDimensions); + data.coverArtists = query.things.map(thing => thing.coverArtistContribs @@ -111,8 +114,12 @@ export default { stitchArrays({ image: relations.images, path: data.paths, - }).map(({image, path}) => - image.slot('path', path)), + dimensions: data.dimensions, + }).map(({image, path, dimensions}) => + image.slots({ + path, + dimensions, + })), info: data.coverArtists.map(names => diff --git a/src/content/dependencies/generateArtistGalleryPage.js b/src/content/dependencies/generateArtistGalleryPage.js index 13779159..36343c18 100644 --- a/src/content/dependencies/generateArtistGalleryPage.js +++ b/src/content/dependencies/generateArtistGalleryPage.js @@ -68,6 +68,9 @@ export default { ? ['media.trackCover', thing.album.directory, thing.directory, thing.coverArtFileExtension] : ['media.albumCover', thing.directory, thing.coverArtFileExtension])); + data.dimensions = + query.things.map(thing => thing.coverArtDimensions); + data.otherCoverArtists = query.things.map(thing => (thing.coverArtistContribs.length > 1 @@ -107,8 +110,12 @@ export default { stitchArrays({ image: relations.images, path: data.paths, - }).map(({image, path}) => - image.slot('path', path)), + dimensions: data.dimensions, + }).map(({image, path, dimensions}) => + image.slots({ + path, + dimensions, + })), info: data.otherCoverArtists.map(names => -- cgit 1.3.0-6-gf8a5