diff options
Diffstat (limited to 'src/data/things/track.js')
-rw-r--r-- | src/data/things/track.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js index 6ac417b5..69eb98a5 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -63,6 +63,7 @@ import { inheritContributionListFromMainRelease, inheritFromMainRelease, withAlbum, + withAllReleases, withAlwaysReferenceByDirectory, withContainingTrackSection, withDate, @@ -419,6 +420,17 @@ export class Track extends Thing { }), ], + // Only has any value for main releases, because secondary releases + // are never secondary to *another* secondary release. + secondaryReleases: reverseReferenceList({ + reverse: soupyReverse.input('tracksWhichAreSecondaryReleasesOf'), + }), + + allReleases: [ + withAllReleases(), + exposeDependency({dependency: '#allReleases'}), + ], + otherReleases: [ withOtherReleases(), exposeDependency({dependency: '#otherReleases'}), @@ -679,6 +691,13 @@ export class Track extends Thing { referencing: track => [track], referenced: track => track.commentatorArtists, }, + + tracksWhichAreSecondaryReleasesOf: { + bindTo: 'trackData', + + referencing: track => track.isSecondaryRelease ? [track] : [], + referenced: track => [track.mainReleaseTrack], + }, }; // Track YAML loading is handled in album.js. |