diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-05-12 19:04:35 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-05-12 19:04:35 -0300 |
commit | 9dbc0792c8988e97b1b93b83b27b1aa62dfc1875 (patch) | |
tree | 600dc05550fef6aebd6d44126636b14ccc0c9366 /src/data/things.js | |
parent | 6f9e037670476a0829c133872ab3271a0f29de47 (diff) |
new Additional Files data field
Diffstat (limited to 'src/data/things.js')
-rw-r--r-- | src/data/things.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/data/things.js b/src/data/things.js index 0695b0d3..80e22e3e 100644 --- a/src/data/things.js +++ b/src/data/things.js @@ -4,6 +4,7 @@ import CacheableObject from './cacheable-object.js'; import { + isAdditionalFileList, isBoolean, isColor, isCommentary, @@ -207,6 +208,26 @@ Thing.common = { update: {validate: isCommentary} }), + // This is a somewhat more involved data structure - it's for additional + // or "bonus" files associated with albums or tracks (or anything else). + // It's got this form: + // + // [ + // {title: 'Booklet', files: ['Booklet.pdf']}, + // { + // title: 'Wallpaper', + // description: 'Cool Wallpaper!', + // files: ['1440x900.png', '1920x1080.png'] + // }, + // {title: 'Alternate Covers', description: null, files: [...]}, + // ... + // ] + // + additionalFiles: () => ({ + flags: {update: true, expose: true}, + update: {validate: isAdditionalFileList} + }), + // A reference list! Keep in mind this is for general references to wiki // objects of (usually) other Thing subclasses, not specifically leitmotif // references in tracks (although that property uses referenceList too!). @@ -497,6 +518,7 @@ Album.propertyDescriptors = { isListedOnHomepage: Thing.common.flag(true), commentary: Thing.common.commentary(), + additionalFiles: Thing.common.additionalFiles(), // Update only @@ -566,6 +588,7 @@ Album[S.serializeDescriptors] = { isListedOnHomepage: S.id, commentary: S.id, + additionalFiles: S.id, tracks: S.toRefs, groups: S.toRefs, @@ -712,6 +735,7 @@ Track.propertyDescriptors = { commentary: Thing.common.commentary(), lyrics: Thing.common.simpleString(), + additionalFiles: Thing.common.additionalFiles(), // Update only |