« get me outta code hell

data: artist: don't depend on hasCoverArt expose-only prop - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/album.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-02 12:43:39 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-02 12:45:16 -0300
commit1ac4ee874047636ed9013350c3db2d5e49d7669a (patch)
tree231cf1a34570a6191de9493872259ebe2ecf8929 /src/data/things/album.js
parent5981f69fac3e0d303425b8df125cd9e705c9eea8 (diff)
data: artist: don't depend on hasCoverArt expose-only prop
Diffstat (limited to 'src/data/things/album.js')
-rw-r--r--src/data/things/album.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 4741652..d371f51 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -1,5 +1,6 @@
 import Thing from './thing.js';
 
+import {empty} from '../../util/sugar.js';
 import find from '../../util/find.js';
 
 export class Album extends Thing {
@@ -34,12 +35,12 @@ export class Album extends Thing {
       update: {validate: isDate},
 
       expose: {
-        dependencies: ['date', 'hasCoverArt'],
+        dependencies: ['date', 'coverArtistContribsByRef'],
         transform: (coverArtDate, {
+          coverArtistContribsByRef,
           date,
-          hasCoverArt,
         }) =>
-          (hasCoverArt
+          (!empty(coverArtistContribsByRef)
             ? coverArtDate ?? date ?? null
             : null),
       },