« get me outta code hell

content, data: Track.excludingURLs - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/Track.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-11 21:23:46 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-11 21:23:46 -0300
commitb68e658e27ae3c6e799342e69dfe3ee45cd53d7b (patch)
tree86f176400b4974df10f59989b6f3bc6b5ee3926e /src/data/things/Track.js
parenteec8c7dfed1bf98607d94160a735132f98b13270 (diff)
content, data: Track.excludingURLs preview
Diffstat (limited to 'src/data/things/Track.js')
-rw-r--r--src/data/things/Track.js35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/data/things/Track.js b/src/data/things/Track.js
index 6a31cfe6..b0c8d955 100644
--- a/src/data/things/Track.js
+++ b/src/data/things/Track.js
@@ -383,7 +383,31 @@ export class Track extends Thing {
       },
     ],
 
-    urls: urls(),
+    excludingURLs: {
+      flags: {update: true, expose: true},
+
+      update: {
+        validate:
+          is(...[
+            'quietly',
+            'generic',
+            'not clearly public',
+            'paid bonus track',
+          ]),
+      },
+    },
+
+    urls: [
+      {
+        dependencies: ['excludingURLs'],
+        compute: (continuation, {excludingURLs}) =>
+          (excludingURLs
+            ? continuation.exit([])
+            : continuation()),
+      },
+
+      urls(),
+    ],
 
     // > Update & expose - Artworks
 
@@ -1034,6 +1058,10 @@ export class Track extends Thing {
         property: 'needsLyrics',
       },
 
+      'Excluding URLs': {
+        property: 'excludingURLs',
+      },
+
       'URLs': {
         property: 'urls',
         transform: parseURLs,
@@ -1165,6 +1193,11 @@ export class Track extends Thing {
           'Cover Artists',
         ],
       },
+
+      {message: `Don't include URLs alongside Excluding URLs`, fields: [
+        'URLs',
+        'Excluding URLs',
+      ]},
     ],
   };