« 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/generateAlbumTrackListItem.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/content/dependencies/generateAlbumTrackListItem.js b/src/content/dependencies/generateAlbumTrackListItem.js
index 794c4201..15aecba0 100644
--- a/src/content/dependencies/generateAlbumTrackListItem.js
+++ b/src/content/dependencies/generateAlbumTrackListItem.js
@@ -24,9 +24,12 @@ export default {
   data(track, album) {
     const data = {};
 
-    data.color = track.color;
     data.duration = track.duration ?? 0;
 
+    if (track.color !== album.color) {
+      data.color = track.color;
+    }
+
     data.showArtists =
       !compareArrays(
         track.artistContribs.map(c => c.who),
@@ -47,8 +50,12 @@ export default {
     const parts = ['trackList.item.withDuration'];
     const options = {};
 
-    options.duration = language.formatDuration(data.duration);
-    options.track = relations.trackLink;
+    options.duration =
+      language.formatDuration(data.duration);
+
+    options.track =
+      relations.trackLink
+        .slot('color', false);
 
     if (data.showArtists) {
       parts.push('withArtists');