From 1925d95bc715aa5b0cefb701a90defd57b401083 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 23 Jun 2023 20:18:58 -0300 Subject: generateGroupGalleryPage: incl. # of tracks, duration in grid info --- src/content/dependencies/generateGroupGalleryPage.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/content') diff --git a/src/content/dependencies/generateGroupGalleryPage.js b/src/content/dependencies/generateGroupGalleryPage.js index 168bf799..d7984416 100644 --- a/src/content/dependencies/generateGroupGalleryPage.js +++ b/src/content/dependencies/generateGroupGalleryPage.js @@ -103,6 +103,9 @@ export default { data.totalDuration = getTotalDuration(tracks, {originalReleasesOnly: true}); data.gridNames = albums.map(album => album.name); + data.gridDurations = albums.map(album => getTotalDuration(album.tracks)); + data.gridNumTracks = albums.map(album => album.tracks.length); + data.gridPaths = albums.map(album => (album.hasCoverArt @@ -186,6 +189,15 @@ export default { album: name, }), })), + info: + stitchArrays({ + numTracks: data.gridNumTracks, + duration: data.gridDurations, + }).map(({numTracks, duration}) => + language.$('misc.albumGrid.details', { + tracks: language.countTracks(numTracks, {unit: true}), + time: language.formatDuration(duration), + })), }), ], -- cgit 1.3.0-6-gf8a5