« get me outta code hell

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:
Diffstat (limited to 'src/data/things/track.js')
-rw-r--r--src/data/things/track.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 36e3adb..e176acb 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -1,10 +1,10 @@
-import Thing from './thing.js';
+import {inspect} from 'node:util';
 
-import {inspect} from 'util';
+import {color} from '#cli';
+import find from '#find';
+import {empty} from '#sugar';
 
-import {color} from '../../util/cli.js';
-import find from '../../util/find.js';
-import {empty} from '../../util/sugar.js';
+import Thing from './thing.js';
 
 export class Track extends Thing {
   static [Thing.referenceType] = 'track';
@@ -47,7 +47,15 @@ export class Track extends Thing {
     hasCoverArt: {
       flags: {update: true, expose: true},
 
-      update: {validate: isBoolean},
+      update: {
+        validate(value) {
+          if (value !== false) {
+            throw new TypeError(`Expected false or null`);
+          }
+
+          return true;
+        },
+      },
 
       expose: {
         dependencies: ['albumData', 'coverArtistContribsByRef'],