« get me outta code hell

content: listArtistsByName: divide by main groups - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-20 21:22:15 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-20 22:08:13 -0300
commit60b6715b38d137f8d6d0ce3c537a546a507ecf1f (patch)
tree1cfeb23a2060793934a3df952a45b9d4a3ee36b0 /src/data/things
parent93fd751aeb3a9c0b60889db0073e7907c87f90fe (diff)
content: listArtistsByName: divide by main groups
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/artist.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 522ca5f9..6d4f4a0d 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -99,6 +99,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},