diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-12-07 06:05:34 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-12-07 06:05:34 -0400 |
commit | df92bfb7c0e48d27bc1490b35b9683aa5611ed51 (patch) | |
tree | a7762a4046695cf85dd79a76e0c19cfd089ab8ff /src/data/things | |
parent | c703a9337b9d4d535c0b503f91684a2fbff89e93 (diff) |
don't expose/show coverArtDate without cover art
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/track.js | 21 |
1 files changed, 15 insertions, 6 deletions
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), }, }, |