« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-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 4db9885e..aac3cfd1 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 58c51a40..234c7edd 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 d6a18978..056b126c 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 3778b9e3..69f910c7 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 45f8390f..03c51699 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 554b4587..7704e97b 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) => ({