« get me outta code hell

fix unique artists not being shown in track list - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-03-07 00:31:48 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-03-07 00:31:48 -0400
commite1141ea9d7554ac03bd1831bf882a45706e0b46b (patch)
tree5c919f3179df72b98e3db7424065d969dfd3dcbb /src/page
parentc72a05cf795b4bab51c2e0cef4eff0bc210fe3e8 (diff)
fix unique artists not being shown in track list
Diffstat (limited to 'src/page')
-rw-r--r--src/page/album.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/page/album.js b/src/page/album.js
index d7447a4c..6bcff886 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -7,13 +7,14 @@ import fixWS from 'fix-whitespace';
 import * as html from '../util/html.js';
 
 import {
-    bindOpts
+    bindOpts,
+    compareArrays,
 } from '../util/sugar.js';
 
 import {
     getAlbumCover,
     getAlbumListTag,
-    getTotalDuration
+    getTotalDuration,
 } from '../util/wiki-data.js';
 
 // Page exports
@@ -36,13 +37,16 @@ export function write(album, {wikiData}) {
             track: link.track(track)
         };
         return `<li style="${getLinkThemeString(track.color)}">${
-            (track.artists === album.artists
+            (compareArrays(
+                track.artistContribs.map(c => c.who),
+                album.artistContribs.map(c => c.who),
+                {checkOrder: false})
                 ? strings('trackList.item.withDuration', itemOpts)
                 : strings('trackList.item.withDuration.withArtists', {
                     ...itemOpts,
                     by: `<span class="by">${
                         strings('trackList.item.withArtists.by', {
-                            artists: getArtistString(track.artists)
+                            artists: getArtistString(track.artistContribs)
                         })
                     }</span>`
                 }))