« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/things.js5
-rw-r--r--src/page/album.js32
-rw-r--r--src/page/flash.js10
-rw-r--r--src/page/track.js8
4 files changed, 29 insertions, 26 deletions
diff --git a/src/data/things.js b/src/data/things.js
index bc4cf3a4..901442dd 100644
--- a/src/data/things.js
+++ b/src/data/things.js
@@ -477,8 +477,11 @@ Album.propertyDescriptors = {
 
     // Expose only
 
-    // Previously known as: (album).artists
     artistContribs: Thing.common.dynamicContribs('artistContribsByRef'),
+    coverArtistContribs: Thing.common.dynamicContribs('coverArtistContribsByRef'),
+    trackCoverArtistContribs: Thing.common.dynamicContribs('trackCoverArtistContribsByRef'),
+    wallpaperArtistContribs: Thing.common.dynamicContribs('wallpaperArtistContribsByRef'),
+    bannerArtistContribs: Thing.common.dynamicContribs('bannerArtistContribsByRef'),
 
     commentatorArtists: Thing.common.commentatorArtists(),
 
diff --git a/src/page/album.js b/src/page/album.js
index 1ebfdecc..23a974c8 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -74,10 +74,10 @@ export function write(album, {wikiData}) {
             duration: albumDuration,
             color: album.color,
             cover: serializeCover(album, getAlbumCover),
-            artists: serializeContribs(album.artists || []),
-            coverArtists: serializeContribs(album.coverArtists || []),
-            wallpaperArtists: serializeContribs(album.wallpaperArtists || []),
-            bannerArtists: serializeContribs(album.bannerArtists || []),
+            artistContribs: serializeContribs(album.artistContribs || []),
+            coverArtistContribs: serializeContribs(album.coverArtistContribs || []),
+            wallpaperArtistContribs: serializeContribs(album.wallpaperArtistContribs || []),
+            bannerArtistContribs: serializeContribs(album.bannerArtistContribs || []),
             groups: serializeGroupsForAlbum(album),
             trackGroups: album.trackGroups?.map(trackGroup => ({
                 name: trackGroup.name,
@@ -137,26 +137,26 @@ export function write(album, {wikiData}) {
                         <h1>${strings('albumPage.title', {album: album.name})}</h1>
                         <p>
                             ${[
-                                album.artists && strings('releaseInfo.by', {
-                                    artists: getArtistString(album.artists, {
+                                album.artistContribs.length && strings('releaseInfo.by', {
+                                    artists: getArtistString(album.artistContribs, {
                                         showContrib: true,
                                         showIcons: true
                                     })
                                 }),
-                                album.coverArtists && strings('releaseInfo.coverArtBy', {
-                                    artists: getArtistString(album.coverArtists, {
+                                album.coverArtistContribs.length && strings('releaseInfo.coverArtBy', {
+                                    artists: getArtistString(album.coverArtistContribs, {
                                         showContrib: true,
                                         showIcons: true
                                     })
                                 }),
-                                album.wallpaperArtists && strings('releaseInfo.wallpaperArtBy', {
-                                    artists: getArtistString(album.wallpaperArtists, {
+                                album.wallpaperArtistContribs.length && strings('releaseInfo.wallpaperArtBy', {
+                                    artists: getArtistString(album.wallpaperArtistContribs, {
                                         showContrib: true,
                                         showIcons: true
                                     })
                                 }),
-                                album.bannerArtists && strings('releaseInfo.bannerArtBy', {
-                                    artists: getArtistString(album.bannerArtists, {
+                                album.bannerArtistContribs.length && strings('releaseInfo.bannerArtBy', {
+                                    artists: getArtistString(album.bannerArtistContribs, {
                                         showContrib: true,
                                         showIcons: true
                                     })
@@ -399,14 +399,14 @@ export function generateAlbumNavLinks(album, currentTrack, {
 export function generateAlbumChronologyLinks(album, currentTrack, {generateChronologyLinks}) {
     return [
         currentTrack && generateChronologyLinks(currentTrack, {
-            contribKey: 'artists',
-            getThings: artist => [...artist.tracks.asArtist, ...artist.tracks.asContributor],
+            contribKey: 'artistContribs',
+            getThings: artist => [...artist.tracksAsArtist, ...artist.tracksAsContributor],
             headingString: 'misc.chronology.heading.track'
         }),
         generateChronologyLinks(currentTrack || album, {
-            contribKey: 'coverArtists',
+            contribKey: 'coverArtistContribs',
             dateKey: 'coverArtDate',
-            getThings: artist => [...artist.albums.asCoverArtist, ...artist.tracks.asCoverArtist],
+            getThings: artist => [...artist.albumsAsCoverArtist, ...artist.tracksAsCoverArtist],
             headingString: 'misc.chronology.heading.coverArt'
         })
     ].filter(Boolean).join('\n');
diff --git a/src/page/flash.js b/src/page/flash.js
index 8f6e4f85..02b20c5d 100644
--- a/src/page/flash.js
+++ b/src/page/flash.js
@@ -55,15 +55,15 @@ export function write(flash, {wikiData}) {
                             ...flash.urls ?? []
                         ].map(url => fancifyFlashURL(url, flash)))
                     })}</p>`}
-                    ${flash.tracks?.length && fixWS`
+                    ${flash.featuredTracks && fixWS`
                         <p>Tracks featured in <i>${flash.name.replace(/\.$/, '')}</i>:</p>
                         <ul>
-                            ${(flash.tracks
+                            ${(flash.featuredTracks
                                 .map(track => strings('trackList.item.withArtists', {
                                     track: link.track(track),
                                     by: `<span class="by">${
                                         strings('trackList.item.withArtists.by', {
-                                            artists: getArtistString(track.artists)
+                                            artists: getArtistString(track.artistContribs)
                                         })
                                     }</span>`
                                 }))
@@ -186,8 +186,8 @@ function generateNavForFlash(flash, {
             <div>
                 ${generateChronologyLinks(flash, {
                     headingString: 'misc.chronology.heading.flash',
-                    contribKey: 'contributors',
-                    getThings: artist => artist.flashes.asContributor
+                    contribKey: 'contributorContribs',
+                    getThings: artist => artist.flashesAsContributor
                 })}
             </div>
         `
diff --git a/src/page/track.js b/src/page/track.js
index a6ec722e..f9c6fe6d 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -103,9 +103,9 @@ export function write(track, {wikiData}) {
             duration: track.duration,
             color: track.color,
             cover: serializeCover(track, getTrackCover),
-            artists: serializeContribs(track.artists),
-            contributors: serializeContribs(track.contributors),
-            coverArtists: serializeContribs(track.coverArtists || []),
+            artistsContribs: serializeContribs(track.artistContribs),
+            contributorContribs: serializeContribs(track.contributorContribs),
+            coverArtistContribs: serializeContribs(track.coverArtistContribs || []),
             album: serializeLink(track.album),
             groups: serializeGroupsForTrack(track),
             references: track.references.map(serializeLink),
@@ -174,7 +174,7 @@ export function write(track, {wikiData}) {
                                         showIcons: true
                                     })
                                 }),
-                                track.coverArtists && strings('releaseInfo.coverArtBy', {
+                                track.coverArtistContribs && strings('releaseInfo.coverArtBy', {
                                     artists: getArtistString(track.coverArtistContribs, {
                                         showContrib: true,
                                         showIcons: true