« get me outta code hell

Merge branch 'preview' into image-overlay - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-03-01 16:19:10 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-03-01 16:19:10 -0400
commit62f64b3aa019747e9c764eda853591b321850ca0 (patch)
tree62e183680ebb4bc5a0015eda957ba367ab11030c /src/data
parent7bf9489f14735f9e44af37f2ade14890a119b403 (diff)
parent1f0924cc94ea10320afe951a2e8fb4906b5e6106 (diff)
Merge branch 'preview' into image-overlay
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/thing.js4
-rw-r--r--src/data/things/track.js2
-rw-r--r--src/data/yaml.js4
3 files changed, 10 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 1778ed27..0751b2d0 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -96,6 +96,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
 
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 6350588d..7cd23cfc 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -248,6 +248,8 @@ export const processTrackDocument = makeProcessDocument(T.Track, {
     'Cover Artists': parseContributors,
 
     'Additional Files': parseAdditionalFiles,
+    'Sheet Music Files': parseAdditionalFiles,
+    'MIDI Project Files': parseAdditionalFiles,
   },
 
   propertyFieldMapping: {
@@ -264,6 +266,8 @@ export const processTrackDocument = makeProcessDocument(T.Track, {
     lyrics: 'Lyrics',
     commentary: 'Commentary',
     additionalFiles: 'Additional Files',
+    sheetMusicFiles: 'Sheet Music Files',
+    midiProjectFiles: 'MIDI Project Files',
 
     originalReleaseTrackByRef: 'Originally Released As',
     referencedTracksByRef: 'Referenced Tracks',