From 1ac4ee874047636ed9013350c3db2d5e49d7669a Mon Sep 17 00:00:00 2001
From: "(quasar) nebula" <qznebula@protonmail.com>
Date: Fri, 2 Jun 2023 12:43:39 -0300
Subject: data: artist: don't depend on hasCoverArt expose-only prop

---
 src/data/things/album.js | 7 ++++---
 src/data/things/thing.js | 4 +---
 2 files changed, 5 insertions(+), 6 deletions(-)

(limited to 'src/data')

diff --git a/src/data/things/album.js b/src/data/things/album.js
index 47416521..d371f51f 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),
       },
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index cefcd012..b74f45f5 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -300,9 +300,7 @@ export default class Thing extends CacheableObject {
 
     // Nice 'n simple shorthand for an exposed-only flag which is true when any
     // contributions are present in the specified property.
-    contribsPresent: (
-      contribsByRefProperty
-    ) => ({
+    contribsPresent: (contribsByRefProperty) => ({
       flags: {expose: true},
       expose: {
         dependencies: [contribsByRefProperty],
-- 
cgit 1.3.0-6-gf8a5