« 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/album.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/album.js')
-rw-r--r--src/data/things/album.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index b8009063..9cbab427 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -11,7 +11,7 @@ import {traverse} from '#node-utils';
 import {sortAlbumsTracksChronologically, sortChronologically} from '#sort';
 import {accumulateSum, empty} from '#sugar';
 import Thing from '#thing';
-import {isColor, isDate, validateWikiData} from '#validators';
+import {isColor, isDate, isDirectory, validateWikiData} from '#validators';
 
 import {
   parseAdditionalFiles,
@@ -75,12 +75,18 @@ export class Album extends Thing {
     // Update & expose
 
     name: name('Unnamed Album'),
-    color: color(),
     directory: directory(),
-    urls: urls(),
+
+    directorySuffix: {
+      flags: {update: true, expose: true},
+      update: {validate: isDirectory},
+    },
 
     alwaysReferenceTracksByDirectory: flag(false),
 
+    color: color(),
+    urls: urls(),
+
     additionalNames: additionalNameList(),
 
     bandcampAlbumIdentifier: simpleString(),
@@ -328,6 +334,7 @@ export class Album extends Thing {
     fields: {
       'Album': {property: 'name'},
       'Directory': {property: 'directory'},
+      'Directory Suffix': {property: 'directorySuffix'},
 
       'Always Reference Tracks By Directory': {
         property: 'alwaysReferenceTracksByDirectory',