« get me outta code hell

data: Track.disableDate / Has Date: false - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-09-18 08:29:13 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-09-18 08:29:13 -0300
commit04258f47265f1ea9e279b2b55912f631348f9ba6 (patch)
treeb80e0eccea4253f8e2238ee4ae049b786540ffee
parent32757ce4eaaf0a1c8fe0c1219c3ef5ca625fe066 (diff)
data: Track.disableDate / Has Date: false
-rw-r--r--src/data/composite/things/track/withDate.js8
-rw-r--r--src/data/things/track.js9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/data/composite/things/track/withDate.js b/src/data/composite/things/track/withDate.js
index b5a770e9..1851c0d2 100644
--- a/src/data/composite/things/track/withDate.js
+++ b/src/data/composite/things/track/withDate.js
@@ -12,6 +12,14 @@ export default templateCompositeFrom({
 
   steps: () => [
     {
+      dependencies: ['disableDate'],
+      compute: (continuation, {disableDate}) =>
+        (disableDate
+          ? continuation.raiseOutput({'#date': null})
+          : continuation()),
+    },
+
+    {
       dependencies: ['dateFirstReleased'],
       compute: (continuation, {dateFirstReleased}) =>
         (dateFirstReleased
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 9b4a2f18..87eca2e9 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -243,6 +243,7 @@ export class Track extends Thing {
     ],
 
     disableUniqueCoverArt: flag(),
+    disableDate: flag(),
 
     // > Update & expose - General metadata
 
@@ -619,6 +620,14 @@ export class Track extends Thing {
             : value),
       },
 
+      'Has Date': {
+        property: 'disableDate',
+        transform: value =>
+          (typeof value === 'boolean'
+            ? !value
+            : value),
+      },
+
       // General metadata
 
       'Duration': {