diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-15 10:57:55 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-15 10:57:55 -0400 |
commit | dd5cbf9db64e994d44c922bca2ca8ec37e9f7983 (patch) | |
tree | 56ef644f10f1814c8d58ea04a259e7e6fe02f8bf /src/data/things | |
parent | f2a31006efa7c4d9c7c15823adc70cc40c46dedd (diff) | |
parent | 52cc83065f41472a4c32c2003b0a715a66d4739a (diff) |
Merge branch 'preview' into commentary-entries
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/artist.js | 17 | ||||
-rw-r--r-- | src/data/things/wiki-info.js | 12 |
2 files changed, 26 insertions, 3 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js index e0350b86..a51723c4 100644 --- a/src/data/things/artist.js +++ b/src/data/things/artist.js @@ -107,6 +107,23 @@ export class Artist extends Thing { albumsAsBannerArtist: Artist.filterByContrib('albumData', 'bannerArtistContribs'), + albumsAsAny: { + flags: {expose: true}, + + expose: { + dependencies: ['albumData'], + + compute: ({albumData, [Artist.instance]: artist}) => + albumData?.filter((album) => + [ + ...album.artistContribs, + ...album.coverArtistContribs, + ...album.wallpaperArtistContribs, + ...album.bannerArtistContribs, + ].some(({who}) => who === artist)) ?? [], + }, + }, + albumsAsCommentator: { flags: {expose: true}, diff --git a/src/data/things/wiki-info.js b/src/data/things/wiki-info.js index 89053d62..3db9727b 100644 --- a/src/data/things/wiki-info.js +++ b/src/data/things/wiki-info.js @@ -1,9 +1,8 @@ import {input} from '#composite'; import find from '#find'; -import {isLanguageCode, isName, isURL} from '#validators'; +import {isColor, isLanguageCode, isName, isURL} from '#validators'; import { - color, flag, name, referenceList, @@ -32,7 +31,14 @@ export class WikiInfo extends Thing { }, }, - color: color(), + color: { + flags: {update: true, expose: true}, + update: {validate: isColor}, + + expose: { + transform: color => color ?? '#0088ff', + }, + }, // One-line description used for <meta rel="description"> tag. description: simpleString(), |