« get me outta code hell

use strings.list.unit to join contribs - 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-04-15 19:31:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-04-15 19:31:57 -0300
commit15ef511cd7b1afed7a2b531a0f01ecc7d7bee781 (patch)
treed45aaa42082b4edfed13b609638de06b8c84790c /src/page
parent7809f00b00b584356f1f0430c83045eb0f38cefd (diff)
use strings.list.unit to join contribs
This is kind of a pain to support.
Diffstat (limited to 'src/page')
-rw-r--r--src/page/artist.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index 9d17b483..38ca76d6 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -96,10 +96,10 @@ export function write(artist, {wikiData}) {
                 : track.contributorContribs.filter(({ who }) => who !== artist)),
             contrib: {
                 who: artist,
-                what: [
+                whatArray: [
                     track.artistContribs.find(({ who }) => who === artist)?.what,
                     track.contributorContribs.find(({ who }) => who === artist)?.what
-                ].filter(Boolean).join(', ')
+                ].filter(Boolean)
             }
         })), ['date', 'album'])
         .map(({date, album, chunk}) => ({
@@ -154,20 +154,20 @@ export function write(artist, {wikiData}) {
         (aka
             ? strings('artistPage.creditList.entry.rerelease', {entry})
             : (artists.length
-                ? (contrib.what
+                ? ((contrib.what || contrib.whatArray?.length)
                     ? strings('artistPage.creditList.entry.withArtists.withContribution', {
                         entry,
                         artists: getArtistString(artists),
-                        contribution: contrib.what
+                        contribution: (contrib.whatArray ? strings.list.unit(contrib.whatArray) : contrib.what)
                     })
                     : strings('artistPage.creditList.entry.withArtists', {
                         entry,
                         artists: getArtistString(artists)
                     }))
-                : (contrib.what
+                : ((contrib.what || contrib.whatArray?.length)
                     ? strings('artistPage.creditList.entry.withContribution', {
                         entry,
-                        contribution: contrib.what
+                        contribution: (contrib.whatArray ? strings.list.unit(contrib.whatArray) : contrib.what)
                     })
                     : entry)));