diff options
Diffstat (limited to 'src/data/things/album.js')
-rw-r--r-- | src/data/things/album.js | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js index e4463d27..151b5087 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -44,10 +44,11 @@ import { name, referencedArtworkList, referenceList, - reverseReferencedArtworkList, + reverseReferenceList, simpleDate, simpleString, soupyFind, + soupyReverse, thing, thingList, urls, @@ -262,6 +263,7 @@ export class Album extends Thing { // Update only find: soupyFind(), + reverse: soupyReverse(), // used for referencedArtworkList (mixedFind) albumData: wikiData({ @@ -297,7 +299,9 @@ export class Album extends Thing { value: input.value([]), }), - reverseReferencedArtworkList(), + reverseReferenceList({ + reverse: soupyReverse.input('artworksWhichReference'), + }), ], }); @@ -356,6 +360,55 @@ export class Album extends Thing { }, }; + static [Thing.reverseSpecs] = { + albumsWhoseTracksInclude: { + bindTo: 'albumData', + + referencing: album => [album], + referenced: album => album.tracks, + }, + + albumsWhoseTrackSectionsInclude: { + bindTo: 'albumData', + + referencing: album => [album], + referenced: album => album.trackSections, + }, + + albumsWhoseArtworksFeature: { + bindTo: 'albumData', + + referencing: album => [album], + referenced: album => album.artTags, + }, + + albumsWhoseGroupsInclude: { + bindTo: 'albumData', + + referencing: album => [album], + referenced: album => album.groups, + }, + + albumArtistContributionsBy: + soupyReverse.contributionsBy('albumData', 'artistContribs'), + + albumCoverArtistContributionsBy: + soupyReverse.contributionsBy('albumData', 'coverArtistContribs'), + + albumWallpaperArtistContributionsBy: + soupyReverse.contributionsBy('albumData', 'wallpaperArtistContribs'), + + albumBannerArtistContributionsBy: + soupyReverse.contributionsBy('albumData', 'bannerArtistContribs'), + + albumsWithCommentaryBy: { + bindTo: 'albumData', + + referencing: album => [album], + referenced: album => album.commentatorArtists, + }, + }; + static [Thing.yamlDocumentSpec] = { fields: { 'Album': {property: 'name'}, @@ -624,10 +677,7 @@ export class TrackSection extends Thing { // Update only - // used for withAlbum - albumData: wikiData({ - class: input.value(Album), - }), + reverse: soupyReverse(), // Expose only @@ -712,6 +762,15 @@ export class TrackSection extends Thing { }, }; + static [Thing.reverseSpecs] = { + trackSectionsWhichInclude: { + bindTo: 'trackSectionData', + + referencing: trackSection => [trackSection], + referenced: trackSection => trackSection.tracks, + }, + }; + static [Thing.yamlDocumentSpec] = { fields: { 'Section': {property: 'name'}, |