« get me outta code hell

content: stub track page, misc. other changes - 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:
author(quasar) nebula <qznebula@protonmail.com>2023-04-12 13:20:32 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-12 13:20:32 -0300
commit3a5b49cf3a10702c0dae1190c9baabd8a2c2ef3b (patch)
treec7a1ac0d4c2096733fd3fdfdc549f5695a78532e /src/data
parentb8394a89d31da72ef7d2086a1088a29e68df4edc (diff)
content: stub track page, misc. other changes
* generateContributionLinks replaced with linkContribution,
  tests still need updating

* album pages respect albums without cover art

* track pages without unique art inherit art tags from album
  (fixes #13)

not heavily tested, this commit probably breaks some pages
which were loading correctly before
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/artist.js5
-rw-r--r--src/data/things/thing.js1
2 files changed, 3 insertions, 3 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 303f33f3..f144b21f 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -27,9 +27,8 @@ export class Artist extends Thing {
 
     aliasNames: {
       flags: {update: true, expose: true},
-      update: {
-        validate: validateArrayItems(isName),
-      },
+      update: {validate: validateArrayItems(isName)},
+      expose: {transform: (names) => names ?? []},
     },
 
     isAlias: Thing.common.flag(),
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 5ab15c0e..f0065b55 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -63,6 +63,7 @@ export default class Thing extends CacheableObject {
     urls: () => ({
       flags: {update: true, expose: true},
       update: {validate: validateArrayItems(isURL)},
+      expose: {transform: (value) => value ?? []},
     }),
 
     // A file extension! Or the default, if provided when calling this.