« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/thing/track.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/thing/track.js')
-rw-r--r--src/thing/track.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/thing/track.js b/src/thing/track.js
index d0e88ac..3edabc9 100644
--- a/src/thing/track.js
+++ b/src/thing/track.js
@@ -17,6 +17,7 @@ import {
 } from './validators.js';
 
 import Album from './album.js';
+import Artist from './artist.js';
 import ArtTag from './art-tag.js';
 
 import find from '../util/find.js';
@@ -100,6 +101,7 @@ export default class Track extends Thing {
             update: {validate: validateReferenceList('tag')}
         },
 
+        // Previously known as: (track).aka
         originalReleaseTrackByRef: {
             flags: {update: true, expose: true},
             update: {validate: validateReference('track')}
@@ -117,15 +119,9 @@ export default class Track extends Thing {
 
         // Update only
 
-        albumData: {
-            flags: {update: true},
-            update: {validate: validateArrayItems(x => x instanceof Album)}
-        },
-
-        artTagData: {
-            flags: {update: true},
-            update: {validate: validateArrayItems(x => x instanceof ArtTag)}
-        },
+        albumData: Thing.genWikiDataProperty(Album),
+        artistData: Thing.genWikiDataProperty(Artist),
+        artTagData: Thing.genWikiDataProperty(ArtTag),
 
         // Expose only
 
@@ -152,6 +148,12 @@ export default class Track extends Thing {
             }
         },
 
+        // Previously known as: (track).artists
+        artistContribs: {
+            flags: {expose: true},
+            expose: Thing.genContribsExpose('artistContribsByRef')
+        },
+
         artTags: {
             flags: {expose: true},