« 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/generateAlbumArtInfoBox.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAlbumArtInfoBox.js')
-rw-r--r--src/content/dependencies/generateAlbumArtInfoBox.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/content/dependencies/generateAlbumArtInfoBox.js b/src/content/dependencies/generateAlbumArtInfoBox.js
index f0bfd1b6..8c44c930 100644
--- a/src/content/dependencies/generateAlbumArtInfoBox.js
+++ b/src/content/dependencies/generateAlbumArtInfoBox.js
@@ -4,12 +4,16 @@ export default {
 
   relations: (relation, album) => ({
     wallpaperArtistContributionsLine:
-      relation('generateReleaseInfoContributionsLine',
-        album.wallpaperArtistContribs),
+      (album.wallpaperArtwork
+        ? relation('generateReleaseInfoContributionsLine',
+            album.wallpaperArtwork.artistContribs)
+        : null),
 
     bannerArtistContributionsLine:
-      relation('generateReleaseInfoContributionsLine',
-        album.bannerArtistContribs),
+      (album.bannerArtwork
+        ? relation('generateReleaseInfoContributionsLine',
+            album.bannerArtwork.artistContribs)
+        : null),
   }),
 
   generate: (relations, {html, language}) =>
@@ -22,12 +26,12 @@ export default {
           {[html.joinChildren]: html.tag('br')},
 
           [
-            relations.wallpaperArtistContributionsLine.slots({
+            relations.wallpaperArtistContributionsLine?.slots({
               stringKey: capsule + '.wallpaperArtBy',
               chronologyKind: 'wallpaperArt',
             }),
 
-            relations.bannerArtistContributionsLine.slots({
+            relations.bannerArtistContributionsLine?.slots({
               stringKey: capsule + '.bannerArtBy',
               chronologyKind: 'bannerArt',
             }),