« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/album/AsideTrackSection.js20
-rw-r--r--src/data/things/album/CloseAsideTrackSection.js20
2 files changed, 40 insertions, 0 deletions
diff --git a/src/data/things/album/AsideTrackSection.js b/src/data/things/album/AsideTrackSection.js
new file mode 100644
index 00000000..9b1f9b57
--- /dev/null
+++ b/src/data/things/album/AsideTrackSection.js
@@ -0,0 +1,20 @@
+// Annoying subclass just for direct access in YAML-loading.
+
+import Thing from '#thing';
+
+import {TrackSection} from './TrackSection.js';
+
+export class AsideTrackSection extends TrackSection {
+  static [Thing.getPropertyDescriptors] = () => ({
+    style: {
+      flags: {expose: true},
+      expose: {compute: () => 'aside'},
+    },
+  });
+
+  static [Thing.yamlDocumentSpec] = {
+    fields: {
+      'Aside Section': {property: 'name'},
+    },
+  };
+}
diff --git a/src/data/things/album/CloseAsideTrackSection.js b/src/data/things/album/CloseAsideTrackSection.js
new file mode 100644
index 00000000..19d486a6
--- /dev/null
+++ b/src/data/things/album/CloseAsideTrackSection.js
@@ -0,0 +1,20 @@
+// Mock thing that stands in for closing an "aside" track section.
+// Only exists while loading, is discarded during connect().
+
+import Thing from '#thing';
+import {isString} from '#validators';
+
+export class CloseAsideTrackSection extends Thing {
+  static [Thing.getPropertyDescriptors] = () => ({
+    name: {
+      flags: {update: true, expose: true},
+      update: {validate: isString},
+    },
+  });
+
+  static [Thing.yamlDocumentSpec] = {
+    fields: {
+      'Close Aside Section': {property: 'name'},
+    },
+  };
+}