From df92bfb7c0e48d27bc1490b35b9683aa5611ed51 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 7 Dec 2022 06:05:34 -0400 Subject: don't expose/show coverArtDate without cover art --- src/data/things/track.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/data') diff --git a/src/data/things/track.js b/src/data/things/track.js index d2930ff1..0842bf23 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -164,17 +164,26 @@ export class Track extends Thing { update: {validate: isDate}, expose: { - dependencies: ['albumData', 'dateFirstReleased'], + dependencies: [ + 'albumData', + 'coverArtistContribsByRef', + 'dateFirstReleased', + 'hasCoverArt', + ], transform: (coverArtDate, { albumData, + coverArtistContribsByRef, dateFirstReleased, + hasCoverArt, [Track.instance]: track, }) => - coverArtDate ?? - dateFirstReleased ?? - Track.findAlbum(track, albumData)?.trackArtDate ?? - Track.findAlbum(track, albumData)?.date ?? - null, + (Track.hasCoverArt(track, albumData, coverArtistContribsByRef, hasCoverArt) + ? coverArtDate ?? + dateFirstReleased ?? + Track.findAlbum(track, albumData)?.trackArtDate ?? + Track.findAlbum(track, albumData)?.date ?? + null + : null), }, }, -- cgit 1.3.0-6-gf8a5