diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-20 19:32:03 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-21 07:50:14 -0400 |
commit | bde469f4cede426bd9baa8981b876e82ae290972 (patch) | |
tree | 5bd945a7159dca0d050a84f3ea6913e83e9471e2 /src/data/things | |
parent | 765e039ef94f7cd1365ba9f211bd686beab5e8ec (diff) |
data: add additionalNames wiki property ("Additional Names")
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/track.js | 2 | ||||
-rw-r--r-- | src/data/things/validators.js | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js index 8d310611..f6320677 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -24,6 +24,7 @@ import { import { additionalFiles, + additionalNameList, commentary, commentatorArtists, contributionList, @@ -63,6 +64,7 @@ export class Track extends Thing { name: name('Unnamed Track'), directory: directory(), + additionalNames: additionalNameList(), duration: duration(), urls: urls(), diff --git a/src/data/things/validators.js b/src/data/things/validators.js index 19ad1c0a..71570c5a 100644 --- a/src/data/things/validators.js +++ b/src/data/things/validators.js @@ -373,6 +373,13 @@ export function isURL(string) { return true; } +export const isAdditionalName = validateProperties({ + name: isName, + annotation: optional(isStringNonEmpty), +}); + +export const isAdditionalNameList = validateArrayItems(isAdditionalName); + export function validateReference(type = 'track') { return (ref) => { isStringNonEmpty(ref); |