« get me outta code hell

no coverArtDate for albums without cover art either - 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>2022-12-07 07:28:58 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-12-07 07:28:58 -0400
commit0735a45e0ddf693e35202c7c3ef3c15886139843 (patch)
tree9922c7863f16ce93c4b4aff23e057e5340ebee23
parent2945d5d207b8a359412392587dab843f9a333fa7 (diff)
no coverArtDate for albums without cover art either
-rw-r--r--src/data/things/album.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 4890aaa..281da87 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -36,8 +36,14 @@ export class Album extends Thing {
       update: {validate: isDate},
 
       expose: {
-        dependencies: ['date'],
-        transform: (coverArtDate, {date}) => coverArtDate ?? date ?? null,
+        dependencies: ['date', 'hasCoverArt'],
+        transform: (coverArtDate, {
+          date,
+          hasCoverArt,
+        }) =>
+          (hasCoverArt
+            ? coverArtDate ?? date ?? null
+            : null),
       },
     },