« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateGroupGalleryPageAlbumGrid.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateGroupGalleryPageAlbumGrid.js')
-rw-r--r--src/content/dependencies/generateGroupGalleryPageAlbumGrid.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/content/dependencies/generateGroupGalleryPageAlbumGrid.js b/src/content/dependencies/generateGroupGalleryPageAlbumGrid.js
index 25e57a67..9167a5ad 100644
--- a/src/content/dependencies/generateGroupGalleryPageAlbumGrid.js
+++ b/src/content/dependencies/generateGroupGalleryPageAlbumGrid.js
@@ -37,6 +37,12 @@ export default {
 
         return album.artistContribs;
       }),
+
+    artworks:
+      albums.map(album =>
+        (album.hasCoverArt
+          ? album.coverArtworks[0]
+          : null)),
   }),
 
   relations: (relation, query, albums, _group) => ({
@@ -52,11 +58,8 @@ export default {
         .map(album => relation('linkAlbum', album)),
 
     images:
-      albums
-        .map(album =>
-          (album.hasCoverArt
-            ? relation('image', album.coverArtworks[0])
-            : relation('image')))
+      query.artworks
+        .map(artwork => relation('image', artwork)),
   }),
 
   data: (query, albums, group) => ({
@@ -69,6 +72,9 @@ export default {
     tracks:
       albums.map(album => album.tracks.length),
 
+    allWarnings:
+      query.artworks.flatMap(artwork => artwork?.contentWarnings),
+
     durations:
       albums.map(album =>
         (album.hideDuration
@@ -141,5 +147,7 @@ export default {
                     time: language.formatDuration(duration),
                   })
                 : null)),
+
+        revealAllWarnings: data.allWarnings,
       })),
 };