« get me outta code hell

content, upd8, yaml: adapt to combined artistData - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-30 10:52:20 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-30 14:30:05 -0400
commit7fbc5b87ed05bce433ed959ca18119b72835ee41 (patch)
treea9b96e8e575a927ed2e4a7a16036fce88b9a4a1d /src/content
parentf12bbec38694c30a79655a0be54768cd83f1efb5 (diff)
content, upd8, yaml: adapt to combined artistData
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/listArtistsByCommentaryEntries.js5
-rw-r--r--src/content/dependencies/listArtistsByContributions.js8
-rw-r--r--src/content/dependencies/listArtistsByDuration.js16
-rw-r--r--src/content/dependencies/listArtistsByGroup.js8
-rw-r--r--src/content/dependencies/listArtistsByLatestContribution.js3
-rw-r--r--src/content/dependencies/listArtistsByName.js3
6 files changed, 30 insertions, 13 deletions
diff --git a/src/content/dependencies/listArtistsByCommentaryEntries.js b/src/content/dependencies/listArtistsByCommentaryEntries.js
index 4db9885..aac3cfd 100644
--- a/src/content/dependencies/listArtistsByCommentaryEntries.js
+++ b/src/content/dependencies/listArtistsByCommentaryEntries.js
@@ -10,7 +10,10 @@ export default {
   },
 
   query({artistData}, spec) {
-    const artists = sortAlphabetically(artistData.slice());
+    const artists =
+      sortAlphabetically(
+        artistData.filter(artist => !artist.isAlias));
+
     const counts =
       artists.map(artist =>
         artist.tracksAsCommentator.length +
diff --git a/src/content/dependencies/listArtistsByContributions.js b/src/content/dependencies/listArtistsByContributions.js
index 58c51a4..234c7ed 100644
--- a/src/content/dependencies/listArtistsByContributions.js
+++ b/src/content/dependencies/listArtistsByContributions.js
@@ -25,8 +25,12 @@ export default {
     };
 
     const queryContributionInfo = (artistsKey, countsKey, fn) => {
-      const artists = sortAlphabetically(sprawl.artistData.slice());
-      const counts = artists.map(artist => fn(artist));
+      const artists =
+        sortAlphabetically(
+          sprawl.artistData.filter(artist => !artist.isAlias));
+
+      const counts =
+        artists.map(artist => fn(artist));
 
       filterByCount(artists, counts);
       sortByCount(artists, counts, {greatestFirst: true});
diff --git a/src/content/dependencies/listArtistsByDuration.js b/src/content/dependencies/listArtistsByDuration.js
index d6a1897..056b126 100644
--- a/src/content/dependencies/listArtistsByDuration.js
+++ b/src/content/dependencies/listArtistsByDuration.js
@@ -10,12 +10,16 @@ export default {
   },
 
   query({artistData}, spec) {
-    const artists = sortAlphabetically(artistData.slice());
-    const durations = artists.map(artist =>
-      getTotalDuration([
-        ...(artist.tracksAsArtist ?? []),
-        ...(artist.tracksAsContributor ?? []),
-      ], {originalReleasesOnly: true}));
+    const artists =
+      sortAlphabetically(
+        artistData.filter(artist => !artist.isAlias));
+
+    const durations =
+      artists.map(artist =>
+        getTotalDuration([
+          ...(artist.tracksAsArtist ?? []),
+          ...(artist.tracksAsContributor ?? []),
+        ], {originalReleasesOnly: true}));
 
     filterByCount(artists, durations);
     sortByCount(artists, durations, {greatestFirst: true});
diff --git a/src/content/dependencies/listArtistsByGroup.js b/src/content/dependencies/listArtistsByGroup.js
index 3778b9e..69f910c 100644
--- a/src/content/dependencies/listArtistsByGroup.js
+++ b/src/content/dependencies/listArtistsByGroup.js
@@ -15,8 +15,12 @@ export default {
   },
 
   query(sprawl, spec) {
-    const artists = sortAlphabetically(sprawl.artistData.slice());
-    const groups = sprawl.wikiInfo.divideTrackListsByGroups;
+    const artists =
+      sortAlphabetically(
+        sprawl.artistData.filter(artist => !artist.isAlias));
+
+    const groups =
+      sprawl.wikiInfo.divideTrackListsByGroups;
 
     if (empty(groups)) {
       return {spec, artists};
diff --git a/src/content/dependencies/listArtistsByLatestContribution.js b/src/content/dependencies/listArtistsByLatestContribution.js
index 45f8390..03c5169 100644
--- a/src/content/dependencies/listArtistsByLatestContribution.js
+++ b/src/content/dependencies/listArtistsByLatestContribution.js
@@ -145,7 +145,8 @@ export default {
     //
 
     const artistsAlphabetically =
-      sortAlphabetically(sprawl.artistData.slice());
+      sortAlphabetically(
+        sprawl.artistData.filter(artist => !artist.isAlias));
 
     const artists =
       Array.from(artistLatestContribMap.keys());
diff --git a/src/content/dependencies/listArtistsByName.js b/src/content/dependencies/listArtistsByName.js
index 554b458..7704e97 100644
--- a/src/content/dependencies/listArtistsByName.js
+++ b/src/content/dependencies/listArtistsByName.js
@@ -12,7 +12,8 @@ export default {
     spec,
 
     artists:
-      sortAlphabetically(sprawl.artistData.slice()),
+      sortAlphabetically(
+        sprawl.artistData.filter(artist => !artist.isAlias)),
   }),
 
   relations: (relation, query) => ({