« get me outta code hell

data: artist: drop {tracks,albums}as{Artist,Contributor,..etc..} - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-02 10:56:21 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:06 -0300
commit1d996da933baf57fb79c32b00b35c5c5e15a36f3 (patch)
tree6ec666a9c288e52bc9ee423fc59743202ffd25f1
parent4aa153ebae1360e390b9d372fabf457ee8b21705 (diff)
data: artist: drop {tracks,albums}as{Artist,Contributor,..etc..}
-rw-r--r--src/data/things/artist.js162
1 files changed, 9 insertions, 153 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 738f9c81..5d1d04a0 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -80,68 +80,6 @@ export class Artist extends Thing {
 
     // Expose only
 
-    tracksAsArtist: reverseContributionList({
-      data: 'trackData',
-      list: input.value('artistContribs'),
-    }),
-
-    tracksAsContributor: reverseContributionList({
-      data: 'trackData',
-      list: input.value('contributorContribs'),
-    }),
-
-    tracksAsCoverArtist: reverseContributionList({
-      data: 'trackData',
-      list: input.value('coverArtistContribs'),
-    }),
-
-    tracksAsAny: [
-      withReverseContributionList({
-        data: 'trackData',
-        list: input.value('artistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#tracksAsArtist',
-      }),
-
-      withReverseContributionList({
-        data: 'trackData',
-        list: input.value('contributorContribs'),
-      }).outputs({
-        '#reverseContributionList': '#tracksAsContributor',
-      }),
-
-      withReverseContributionList({
-        data: 'trackData',
-        list: input.value('coverArtistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#tracksAsCoverArtist',
-      }),
-
-      {
-        dependencies: [
-          '#tracksAsArtist',
-          '#tracksAsContributor',
-          '#tracksAsCoverArtist',
-        ],
-
-        compute: ({
-          ['#tracksAsArtist']: tracksAsArtist,
-          ['#tracksAsContributor']: tracksAsContributor,
-          ['#tracksAsCoverArtist']: tracksAsCoverArtist,
-        }) =>
-          unique([
-            ...tracksAsArtist,
-            ...tracksAsContributor,
-            ...tracksAsCoverArtist,
-          ]),
-      },
-    ],
-
-    tracksAsCommentator: reverseReferenceList({
-      data: 'trackData',
-      list: input.value('commentatorArtists'),
-    }),
-
     trackArtistContributions: reverseContributionList({
       data: 'trackData',
       list: input.value('artistContribs'),
@@ -160,80 +98,8 @@ export class Artist extends Thing {
       mode: input.value('contributions'),
     }),
 
-    albumsAsAlbumArtist: reverseContributionList({
-      data: 'albumData',
-      list: input.value('artistContribs'),
-    }),
-
-    albumsAsCoverArtist: reverseContributionList({
-      data: 'albumData',
-      list: input.value('coverArtistContribs'),
-    }),
-
-    albumsAsWallpaperArtist: reverseContributionList({
-      data: 'albumData',
-      list: input.value('wallpaperArtistContribs'),
-    }),
-
-    albumsAsBannerArtist: reverseContributionList({
-      data: 'albumData',
-      list: input.value('bannerArtistContribs'),
-    }),
-
-    albumsAsAny: [
-      withReverseContributionList({
-        data: 'albumData',
-        list: input.value('artistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#albumsAsArtist',
-      }),
-
-      withReverseContributionList({
-        data: 'albumData',
-        list: input.value('coverArtistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#albumsAsCoverArtist',
-      }),
-
-      withReverseContributionList({
-        data: 'albumData',
-        list: input.value('wallpaperArtistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#albumsAsWallpaperArtist',
-      }),
-
-      withReverseContributionList({
-        data: 'albumData',
-        list: input.value('bannerArtistContribs'),
-      }).outputs({
-        '#reverseContributionList': '#albumsAsBannerArtist',
-      }),
-
-      {
-        dependencies: [
-          '#albumsAsArtist',
-          '#albumsAsCoverArtist',
-          '#albumsAsWallpaperArtist',
-          '#albumsAsBannerArtist',
-        ],
-
-        compute: ({
-          ['#albumsAsArtist']: albumsAsArtist,
-          ['#albumsAsCoverArtist']: albumsAsCoverArtist,
-          ['#albumsAsWallpaperArtist']: albumsAsWallpaperArtist,
-          ['#albumsAsBannerArtist']: albumsAsBannerArtist,
-        }) =>
-          unique([
-            ...albumsAsArtist,
-            ...albumsAsCoverArtist,
-            ...albumsAsWallpaperArtist,
-            ...albumsAsBannerArtist,
-          ]),
-      },
-    ],
-
-    albumsAsCommentator: reverseReferenceList({
-      data: 'albumData',
+    tracksAsCommentator: reverseReferenceList({
+      data: 'trackData',
       list: input.value('commentatorArtists'),
     }),
 
@@ -261,13 +127,8 @@ export class Artist extends Thing {
       mode: input.value('contributions'),
     }),
 
-    flashesAsContributor: reverseContributionList({
-      data: 'flashData',
-      list: input.value('contributorContribs'),
-    }),
-
-    flashesAsCommentator: reverseReferenceList({
-      data: 'flashData',
+    albumsAsCommentator: reverseReferenceList({
+      data: 'albumData',
       list: input.value('commentatorArtists'),
     }),
 
@@ -277,6 +138,11 @@ export class Artist extends Thing {
       mode: input.value('contributions'),
     }),
 
+    flashesAsCommentator: reverseReferenceList({
+      data: 'flashData',
+      list: input.value('commentatorArtists'),
+    }),
+
     totalDuration: artistTotalDuration(),
   });
 
@@ -293,18 +159,8 @@ export class Artist extends Thing {
 
     aliasNames: S.id,
 
-    tracksAsArtist: S.toRefs,
-    tracksAsContributor: S.toRefs,
-    tracksAsCoverArtist: S.toRefs,
     tracksAsCommentator: S.toRefs,
-
-    albumsAsAlbumArtist: S.toRefs,
-    albumsAsCoverArtist: S.toRefs,
-    albumsAsWallpaperArtist: S.toRefs,
-    albumsAsBannerArtist: S.toRefs,
     albumsAsCommentator: S.toRefs,
-
-    flashesAsContributor: S.toRefs,
   });
 
   static [Thing.findSpecs] = {