From cfa02cb03a363c46408db7f0ec54bd3a7e4ad018 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 12 Feb 2022 15:27:14 -0400 Subject: brb gonna make these into one file now --- src/thing/track.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/thing/track.js') 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}, -- cgit 1.3.0-6-gf8a5