« get me outta code hell

content: generateArtistRollingWindowPage: content warnings - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-11 19:55:28 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-11 08:23:22 -0300
commit6d64c58216d073b729afe02f69e4a14152ff3963 (patch)
tree7503b26d302b94c231d72bd365dc2abd189aa4f6
parentf8b24147722763117c3bc3a2368c7b4ac2826ea4 (diff)
content: generateArtistRollingWindowPage: content warnings
-rw-r--r--src/content/dependencies/generateArtistRollingWindowPage.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/content/dependencies/generateArtistRollingWindowPage.js b/src/content/dependencies/generateArtistRollingWindowPage.js
index bfc780e5..30909201 100644
--- a/src/content/dependencies/generateArtistRollingWindowPage.js
+++ b/src/content/dependencies/generateArtistRollingWindowPage.js
@@ -185,7 +185,16 @@ export default {
       relation('generateCoverGrid'),
 
     sourceGridImages:
-      query.things.map(() => relation('image')),
+      query.things.map(thing =>
+         (thing.constructor[Thing.referenceType] === 'album' && thing.hasCoverArt
+           ? relation('image', thing.artTags)
+        : thing.constructor[Thing.referenceType] === 'track'
+           ? (thing.hasUniqueCoverArt
+               ? relation('image', thing.artTags)
+            : thing.album.hasCoverArt
+               ? relation('image', thing.album.artTags)
+               : relation('image'))
+           : relation('image'))),
 
     sourceGridLinks:
       query.things.map(thing =>