From a2488d2f5f5d1b9ef096c2d9968c56e6439adcac Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 3 Jan 2025 08:11:15 -0400 Subject: data: with{Resolved,Reverse}AnnotatedReferenceList: dates --- src/data/things/album.js | 20 ++++++++++++++++++-- src/data/things/group.js | 2 ++ src/data/things/track.js | 8 +++++++- 3 files changed, 27 insertions(+), 3 deletions(-) (limited to 'src/data/things') diff --git a/src/data/things/album.js b/src/data/things/album.js index 303c64b6..af3c6a92 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -106,7 +106,10 @@ export class Album extends Thing { dateAddedToWiki: simpleDate(), coverArtDate: [ - // TODO: Why does this fall back, but Track.coverArtDate doesn't? + // ~~TODO: Why does this fall back, but Track.coverArtDate doesn't?~~ + // TODO: OK so it's because tracks don't *store* dates just like that. + // Really instead of fallback being a flag, it should be a date value, + // if this option is worth existing at all. withCoverArtDate({ from: input.updateValue({ validate: isDate, @@ -242,7 +245,20 @@ export class Album extends Thing { value: input.value([]), }), - referencedArtworkList(), + { + dependencies: ['coverArtDate', 'date'], + compute: (continuation, { + coverArtDate, + date, + }) => continuation({ + ['#date']: + coverArtDate ?? date, + }), + }, + + referencedArtworkList({ + date: '#date', + }), ], // Update only diff --git a/src/data/things/group.js b/src/data/things/group.js index 68f7545d..8418cb99 100644 --- a/src/data/things/group.js +++ b/src/data/things/group.js @@ -35,6 +35,8 @@ export class Group extends Thing { find: input.value(find.artist), data: 'artistData', + date: input.value(null), + reference: input.value('artist'), thing: input.value('artist'), }), diff --git a/src/data/things/track.js b/src/data/things/track.js index 7934daa6..a0d2f641 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -365,7 +365,13 @@ export class Track extends Thing { value: input.value([]), }), - referencedArtworkList(), + withTrackArtDate({ + fallback: input.value(true), + }), + + referencedArtworkList({ + date: '#trackArtDate', + }), ], // Update only -- cgit 1.3.0-6-gf8a5