« get me outta code hell

exclude re-releases from referencedByTracks prop - 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-05-22 13:17:53 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-22 13:17:53 -0300
commitcaba536171879628837ce2647283526295d4b564 (patch)
tree83e23cba68d0613665687ab8ee9987ab2bba34ae /src/page
parent71d66c237a56a5d67a6cffbc4db9ff0c958fed5c (diff)
exclude re-releases from referencedByTracks prop
Diffstat (limited to 'src/page')
-rw-r--r--src/page/track.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/page/track.js b/src/page/track.js
index 22e6c9da..d51cee21 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -40,17 +40,13 @@ export function write(track, {wikiData}) {
             .flatMap(track => track.featuredInFlashes.map(flash => ({flash, as: track}))));
     }
 
-    const unbound_getTrackItem = (track, {getArtistString, link, language}) => {
-        const line = language.$('trackList.item.withArtists', {
+    const unbound_getTrackItem = (track, {getArtistString, link, language}) => (
+        html.tag('li', language.$('trackList.item.withArtists', {
             track: link.track(track),
             by: `<span class="by">${language.$('trackList.item.withArtists.by', {
                 artists: getArtistString(track.artistContribs)
             })}</span>`
-        });
-        return (track.aka
-            ? `<li class="rerelease">${language.$('trackList.item.rerelease', {track: line})}</li>`
-            : `<li>${line}</li>`);
-    };
+        })));
 
     const unbound_generateTrackList = (tracks, {getArtistString, link, language}) => html.tag('ul',
         tracks.map(track => unbound_getTrackItem(track, {getArtistString, link, language}))
@@ -156,7 +152,6 @@ export function write(track, {wikiData}) {
             to,
             urls,
         }) => {
-            const generateTrackList = bindOpts(unbound_generateTrackList, {getArtistString, link, language});
             const getTrackItem = bindOpts(unbound_getTrackItem, {getArtistString, link, language});
             const cover = getTrackCover(track);
 
@@ -254,7 +249,7 @@ export function write(track, {wikiData}) {
                         `}
                         ${referencedTracks.length && fixWS`
                             <p>${language.$('releaseInfo.tracksReferenced', {track: `<i>${track.name}</i>`})}</p>
-                            ${generateTrackList(referencedTracks)}
+                            ${html.tag('ul', referencedTracks.map(getTrackItem))}
                         `}
                         ${referencedByTracks.length && fixWS`
                             <p>${language.$('releaseInfo.tracksThatReference', {track: `<i>${track.name}</i>`})}</p>