From 971b9fb1d861682fa6f82c005244edd56f6a7377 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 24 Jun 2023 18:23:11 -0300 Subject: content: generateAlbumTrackListItem: incl. color only if different from album --- src/content/dependencies/generateAlbumTrackListItem.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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'); -- cgit 1.3.0-6-gf8a5