From 180bcfd0fce3631d13f46f3d27851e09acc05c63 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Mar 2022 22:58:24 -0400 Subject: otherReleases works on original release too --- src/data/things.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/data/things.js b/src/data/things.js index c873f5e3..b48642a6 100644 --- a/src/data/things.js +++ b/src/data/things.js @@ -716,33 +716,32 @@ Track.propertyDescriptors = { } }, + originalReleaseTrack: Thing.common.dynamicThingFromSingleReference('originalReleaseTrackByRef', 'trackData', find.track), + otherReleases: { flags: {expose: true}, expose: { dependencies: ['originalReleaseTrackByRef', 'trackData'], - compute: ({ originalReleaseTrackByRef: ref1, trackData, [Track.instance]: t1 }) => { - if (!(ref1 && trackData)) { + compute: ({ originalReleaseTrackByRef: t1origRef, trackData, [Track.instance]: t1 }) => { + if (!trackData) { return []; } - const tOrig = find.track(ref1, trackData); - if (!tOrig) { - return []; - } + const t1orig = find.track(t1origRef, trackData); return [ - tOrig, + t1orig, ...trackData.filter(t2 => { - const { originalReleaseTrackByRef: ref2 } = t2; + const { originalReleaseTrack: t2orig } = t2; return ( t2 !== t1 && - ref2 && - find.track(ref2, trackData) === tOrig + t2orig && + (t2orig === t1orig || t2orig === t1) ); }) - ]; + ].filter(Boolean); } } }, -- cgit 1.3.0-6-gf8a5