diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-03-05 20:35:39 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-03-05 20:35:39 -0400 |
commit | e6978019a002e59db8dc312b9c2caa3c2ee9d9fe (patch) | |
tree | f2bea655842e3e7b5e6e91d1352bfe98138b674a /src | |
parent | be689a52e3699eba71d13ea6438a4fa0103eb514 (diff) |
fix cover artist info, chronology links
Diffstat (limited to 'src')
-rw-r--r-- | src/data/things.js | 5 | ||||
-rw-r--r-- | src/page/album.js | 32 | ||||
-rw-r--r-- | src/page/flash.js | 10 | ||||
-rw-r--r-- | src/page/track.js | 8 |
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 |