diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-06-04 08:55:25 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-06-04 08:55:25 -0300 |
| commit | aeed300cb9f4fc543a4fdadc294106e455900309 (patch) | |
| tree | 1f317d539dd78b6c5caaad91c65246d9ff3330e2 /src/data/things/album/Album.js | |
| parent | aee74d1a422ca41a2f7fac7cf4cbc5e9285243a8 (diff) | |
content, data: Track.datePosted, etc
Diffstat (limited to 'src/data/things/album/Album.js')
| -rw-r--r-- | src/data/things/album/Album.js | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/data/things/album/Album.js b/src/data/things/album/Album.js index 47abb73a..1a07656a 100644 --- a/src/data/things/album/Album.js +++ b/src/data/things/album/Album.js @@ -223,7 +223,8 @@ export class Album extends Thing { additionalNames: thingList(V(AdditionalName)), - date: simpleDate(), + dateReleased: simpleDate(), + datePosted: simpleDate(), dateAddedToWiki: simpleDate(), // > Update & expose - Credits and contributors @@ -527,6 +528,27 @@ export class Album extends Thing { withFlattenedList('#trackSections.tracks'), exposeDependency('#flattenedList'), ], + + date: [ + exposeDependencyOrContinue('dateReleased'), + exposeDependencyOrContinue('datePosted'), + exposeConstant(V(null)), + ], + + dateStyle: [ + exitWithoutDependency('date'), + + { + dependencies: ['_dateReleased', '_datePosted'], + compute: ({ + ['_dateReleased']: dateReleased, + ['_datePosted']: datePosted, + }) => + (dateReleased ? 'released' + : datePosted ? 'posted' + : null), + }, + ] }); static [Thing.getSerializeDescriptors] = ({ @@ -721,15 +743,9 @@ export class Album extends Thing { transform: parseAdditionalNames, }, - 'Date': { - property: 'date', - transform: parseDate, - }, - - 'Date Added': { - property: 'dateAddedToWiki', - transform: parseDate, - }, + 'Date': {property: 'dateReleased', transform: parseDate}, + 'Date Posted': {property: 'datePosted', transform: parseDate}, + 'Date Added': {property: 'dateAddedToWiki', transform: parseDate}, // Credits and contributors |