From 71de050864a42afcaeb409c11b9c792653cf2f1b Mon Sep 17 00:00:00 2001
From: "(quasar) nebula"
${ + ${album.urls?.length && `
${ strings('releaseInfo.listenOn', { links: strings.list.or(album.urls.map(url => fancifyURL(url, {album: true}))) }) @@ -263,12 +265,16 @@ export function generateAlbumSidebar(album, currentTrack, { }) { const listTag = getAlbumListTag(album); + /* const trackGroups = album.trackGroups || [{ name: strings('albumSidebar.trackList.fallbackGroupName'), color: album.color, startIndex: 0, tracks: album.tracks }]; + */ + + const { trackGroups } = album; const trackToListItem = track => html.tag('li', {class: track === currentTrack && 'current'}, @@ -276,9 +282,14 @@ export function generateAlbumSidebar(album, currentTrack, { track: link.track(track) })); + const nameOrDefault = (isDefaultTrackGroup, name) => + (isDefaultTrackGroup + ? strings('albumSidebar.trackList.fallbackGroupName') + : name); + const trackListPart = fixWS`
${ + ${group.urls?.length && `
${ strings('releaseInfo.visitOn', { links: strings.list.or(group.urls.map(url => fancifyURL(url))) }) diff --git a/src/page/track.js b/src/page/track.js index b3cec414..a6ec722e 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -35,23 +35,20 @@ export function targets({wikiData}) { export function write(track, {wikiData}) { const { groupData, wikiInfo } = wikiData; - const { album } = track; + const { album, referencedByTracks, referencedTracks, otherReleases } = track; - const tracksThatReference = track.referencedBy; const useDividedReferences = groupData.some(group => group.directory === OFFICIAL_GROUP_DIRECTORY); - const ttrFanon = (useDividedReferences && - tracksThatReference.filter(t => t.album.groups.every(group => group.directory !== OFFICIAL_GROUP_DIRECTORY))); - const ttrOfficial = (useDividedReferences && - tracksThatReference.filter(t => t.album.groups.some(group => group.directory === OFFICIAL_GROUP_DIRECTORY))); + const rbtFanon = (useDividedReferences && + referencedByTracks.filter(t => t.album.groups.every(group => group.directory !== OFFICIAL_GROUP_DIRECTORY))); + const rbtOfficial = (useDividedReferences && + referencedByTracks.filter(t => t.album.groups.some(group => group.directory === OFFICIAL_GROUP_DIRECTORY))); - const tracksReferenced = track.references; - const otherReleases = track.otherReleases; const listTag = getAlbumListTag(album); let flashesThatFeature; if (wikiInfo.enableFlashesAndGames) { flashesThatFeature = sortByDate([track, ...otherReleases] - .flatMap(track => track.flashes.map(flash => ({flash, as: track})))); + .flatMap(track => track.featuredInFlashes.map(flash => ({flash, as: track})))); } const unbound_generateTrackList = (tracks, {getArtistString, link, strings}) => html.tag('ul', @@ -59,7 +56,7 @@ export function write(track, {wikiData}) { const line = strings('trackList.item.withArtists', { track: link.track(track), by: `${strings('trackList.item.withArtists.by', { - artists: getArtistString(track.artists) + artists: getArtistString(track.artistContribs) })}` }); return (track.aka @@ -172,13 +169,13 @@ export function write(track, {wikiData}) {
${[
strings('releaseInfo.by', {
- artists: getArtistString(track.artists, {
+ artists: getArtistString(track.artistContribs, {
showContrib: true,
showIcons: true
})
}),
track.coverArtists && strings('releaseInfo.coverArtBy', {
- artists: getArtistString(track.coverArtists, {
+ artists: getArtistString(track.coverArtistContribs, {
showContrib: true,
showIcons: true
})
@@ -186,16 +183,18 @@ export function write(track, {wikiData}) {
album.directory !== UNRELEASED_TRACKS_DIRECTORY && strings('releaseInfo.released', {
date: strings.count.date(track.date)
}),
- +track.coverArtDate !== +track.date && strings('releaseInfo.artReleased', {
- date: strings.count.date(track.coverArtDate)
- }),
+ (track.coverArtDate &&
+ +track.coverArtDate !== +track.date &&
+ strings('releaseInfo.artReleased', {
+ date: strings.count.date(track.coverArtDate)
+ })),
track.duration && strings('releaseInfo.duration', {
duration: strings.count.duration(track.duration)
})
].filter(Boolean).join('
\n')}
${ - (track.urls.length + (track.urls?.length ? strings('releaseInfo.listenOn', { links: strings.list.or(track.urls.map(url => fancifyURL(url, {strings}))) }) @@ -212,17 +211,10 @@ export function write(track, {wikiData}) { `).join('\n')} `} - ${track.contributors.textContent && fixWS` -
- ${strings('releaseInfo.contributors')}
-
- ${transformInline(track.contributors.textContent)}
-
${strings('releaseInfo.contributors')}
${strings('releaseInfo.tracksReferenced', {track: `${track.name}`})}
- ${generateTrackList(tracksReferenced)} + ${generateTrackList(referencedTracks)} `} - ${tracksThatReference.length && fixWS` + ${referencedByTracks.length && fixWS`${strings('releaseInfo.tracksThatReference', {track: `${track.name}`})}
${useDividedReferences && fixWS`${strings('releaseInfo.flashesThatFeature', {track: `${track.name}`})}
-- cgit 1.3.0-6-gf8a5