« get me outta code hell

content: listArtistsByLatestContribution: processing fixes - 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>2023-07-05 22:29:19 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-05 22:29:19 -0300
commit556eda40caf7f3921507d90afc81073bb74fbd43 (patch)
tree20498273a42472613dca19e2c8c3e7e0677e3d83 /src/content
parent36c25f298c5dfb9478157e61aacff53227a0ed1e (diff)
content: listArtistsByLatestContribution: processing fixes
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/listArtistsByLatestContribution.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/content/dependencies/listArtistsByLatestContribution.js b/src/content/dependencies/listArtistsByLatestContribution.js
index 450c3d9f..3b9b3a51 100644
--- a/src/content/dependencies/listArtistsByLatestContribution.js
+++ b/src/content/dependencies/listArtistsByLatestContribution.js
@@ -81,7 +81,7 @@ export default {
               reduceMultipleArrays(
                 chunkThings, dates,
                 (accChunkThing, accDate, chunkThing, date) =>
-                  (date && date < accDate
+                  (date && date > accDate
                     ? [chunkThing, date]
                     : [accChunkThing, accDate]))));
 
@@ -118,16 +118,16 @@ export default {
       'albumsByTrackContributions',
       'datesByTrackContributions',
       'datelessArtistsByTrackContributions',
-      artist => [
-        [
-          ...artist.tracksAsArtist.map(track => track.album),
-          ...artist.tracksAsContributor.map(track => track.album),
-        ],
-        [
-          ...artist.tracksAsArtist.map(track => track.date),
-          ...artist.tracksAsContributor.map(track => track.date),
-        ],
-      ]);
+      artist => {
+        const tracks =
+          [...artist.tracksAsArtist, ...artist.tracksAsContributor]
+            .filter(track => !track.originalReleaseTrack);
+
+        const albums = tracks.map(track => track.album);
+        const dates = tracks.map(track => track.date);
+
+        return [albums, dates];
+      });
 
     queryContributionInfo(
       'artistsByArtworkContributions',