« get me outta code hell

new 'Sheet Music Files' & 'MIDI Project Files' fields - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-02-26 17:43:15 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-02-26 17:48:26 -0400
commit212c5fe9972dad3c53826c0364376a98b6c5a3c3 (patch)
tree525d95e57617b39bf3d1961454cd928a99db7341 /src/data/things
parent84081cc3b5287f925ffeeb94ae730e4c143b5f59 (diff)
new 'Sheet Music Files' & 'MIDI Project Files' fields
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/thing.js4
-rw-r--r--src/data/things/track.js2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index b9fa60c6..5ab15c0e 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -148,6 +148,10 @@ export default class Thing extends CacheableObject {
     additionalFiles: () => ({
       flags: {update: true, expose: true},
       update: {validate: isAdditionalFileList},
+      expose: {
+        transform: (additionalFiles) =>
+          additionalFiles ?? [],
+      },
     }),
 
     // A reference list! Keep in mind this is for general references to wiki
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 6b1e958b..aecc876f 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -98,6 +98,8 @@ export class Track extends Thing {
     commentary: Thing.common.commentary(),
     lyrics: Thing.common.simpleString(),
     additionalFiles: Thing.common.additionalFiles(),
+    sheetMusicFiles: Thing.common.additionalFiles(),
+    midiProjectFiles: Thing.common.additionalFiles(),
 
     // Update only