diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 20:49:26 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 20:49:26 -0400 |
commit | 77fc589466fc0c04326231638c5ec6026e7948d4 (patch) | |
tree | dbc019e4f72851bd3fa8fd5195d87fe6f6177f7c /src/data/things/track.js | |
parent | 3bb0a89e80fddb985cc1fc4775e58b0d4a7445dc (diff) |
data: soupy reverse
Diffstat (limited to 'src/data/things/track.js')
-rw-r--r-- | src/data/things/track.js | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js index 81ba35bb..ff4750db 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -48,11 +48,11 @@ import { referenceList, referencedArtworkList, reverseReferenceList, - reverseReferencedArtworkList, simpleDate, simpleString, singleReference, soupyFind, + soupyReverse, thing, urls, wikiData, @@ -62,7 +62,6 @@ import { exitWithoutUniqueCoverArt, inheritContributionListFromOriginalRelease, inheritFromOriginalRelease, - trackReverseReferenceList, withAlbum, withAlwaysReferenceByDirectory, withContainingTrackSection, @@ -370,29 +369,18 @@ export class Track extends Thing { // Update only find: soupyFind(), + reverse: soupyReverse(), // used for referencedArtworkList (mixedFind) - // used for withAlbum (reverse) albumData: wikiData({ class: input.value(Album), }), - // used for featuredInFlashes (reverse) - flashData: wikiData({ - class: input.value(Flash), - }), - // used for referencedArtworkList (mixedFind) - // used for trackReverseReferenceList (reverse) trackData: wikiData({ class: input.value(Track), }), - // used for withContainingTrackSection (reverse) - trackSectionData: wikiData({ - class: input.value(TrackSection), - }), - // used for withMatchingContributionPresets (indirectly by Contribution) wikiInfo: thing({ class: input.value(WikiInfo), @@ -439,17 +427,16 @@ export class Track extends Thing { exposeDependency({dependency: '#otherReleases'}), ], - referencedByTracks: trackReverseReferenceList({ - list: input.value('referencedTracks'), + referencedByTracks: reverseReferenceList({ + reverse: soupyReverse.input('tracksWhichReference'), }), - sampledByTracks: trackReverseReferenceList({ - list: input.value('sampledTracks'), + sampledByTracks: reverseReferenceList({ + reverse: soupyReverse.input('tracksWhichSample'), }), featuredInFlashes: reverseReferenceList({ - data: 'flashData', - list: input.value('featuredTracks'), + reverse: soupyReverse.input('flashesWhichFeature'), }), referencedByArtworks: [ @@ -457,7 +444,9 @@ export class Track extends Thing { value: input.value([]), }), - reverseReferencedArtworkList(), + reverseReferenceList({ + reverse: soupyReverse.input('artworksWhichReference'), + }), ], }); @@ -664,6 +653,29 @@ export class Track extends Thing { referencing: track => track.isOriginalRelease ? [track] : [], referenced: track => track.sampledTracks, }, + + tracksWhoseArtworksFeature: { + bindTo: 'trackData', + + referencing: track => [track], + referenced: track => track.artTags, + }, + + trackArtistContributionsBy: + soupyReverse.contributionsBy('trackData', 'artistContribs'), + + trackContributorContributionsBy: + soupyReverse.contributionsBy('trackData', 'contributorContribs'), + + trackCoverArtistContributionsBy: + soupyReverse.contributionsBy('trackData', 'coverArtistContribs'), + + tracksWithCommentaryBy: { + bindTo: 'trackData', + + referencing: track => [track], + referenced: track => track.commentatorArtists, + }, }; // Track YAML loading is handled in album.js. |