« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/things/Track.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/data/things/Track.js b/src/data/things/Track.js
index 79877edb..0ebef43c 100644
--- a/src/data/things/Track.js
+++ b/src/data/things/Track.js
@@ -339,6 +339,8 @@ export class Track extends Thing {
       exposeDependency('#trackSection.countTracksInArtistTotals'),
     ],
 
+    showInReferenceLists: flag(V(true)),
+
     disableUniqueCoverArt: flag(V(false)),
     disableDate: flag(V(false)),
 
@@ -998,6 +1000,7 @@ export class Track extends Thing {
       // General configuration
 
       'Count In Artist Totals': {property: 'countInArtistTotals'},
+      'Show In Reference Lists': {property: 'showInReferenceLists'},
 
       'Has Cover Art': {
         property: 'disableUniqueCoverArt',
@@ -1286,14 +1289,24 @@ export class Track extends Thing {
     tracksWhichReference: {
       bindTo: 'trackData',
 
-      referencing: track => track.isMainRelease ? [track] : [],
+      referencing: track =>
+        (track.isMainRelease &&
+         track.showInReferenceLists
+          ? [track]
+          : []),
+
       referenced: track => track.referencedTracks,
     },
 
     tracksWhichSample: {
       bindTo: 'trackData',
 
-      referencing: track => track.isMainRelease ? [track] : [],
+      referencing: track =>
+        (track.isMainRelease &&
+         track.showInReferenceLists
+          ? [track]
+          : []),
+
       referenced: track => track.sampledTracks,
     },