« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 =>