From 2099c258fc1833ac459c8a43ca0cae9ae6150ad0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 Sep 2023 12:41:20 -0300 Subject: content: listTracksWithExtra: handle dateless albums cleanly --- src/content/dependencies/listTracksWithExtra.js | 12 ++++++++---- src/strings-default.json | 9 ++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/listTracksWithExtra.js b/src/content/dependencies/listTracksWithExtra.js index 73d25e3d..c9f80f35 100644 --- a/src/content/dependencies/listTracksWithExtra.js +++ b/src/content/dependencies/listTracksWithExtra.js @@ -65,10 +65,14 @@ export default { stitchArrays({ albumLink: relations.albumLinks, date: data.dates, - }).map(({albumLink, date}) => ({ - album: albumLink, - date: language.formatDate(date), - })), + }).map(({albumLink, date}) => + (date + ? { + stringsKey: 'withDate', + album: albumLink, + date: language.formatDate(date), + } + : {album: albumLink})), chunkRows: relations.trackLinks diff --git a/src/strings-default.json b/src/strings-default.json index b5e39e97..0ad7a516 100644 --- a/src/strings-default.json +++ b/src/strings-default.json @@ -437,15 +437,18 @@ "listingPage.listTracks.inFlashes.byFlash.chunk.item": "{TRACK} (from {ALBUM})", "listingPage.listTracks.withLyrics.title": "Tracks - with Lyrics", "listingPage.listTracks.withLyrics.title.short": "...with Lyrics", - "listingPage.listTracks.withLyrics.chunk.title": "{ALBUM} ({DATE})", + "listingPage.listTracks.withLyrics.chunk.title": "{ALBUM}", + "listingPage.listTracks.withLyrics.chunk.title.withDate": "{ALBUM} ({DATE})", "listingPage.listTracks.withLyrics.chunk.item": "{TRACK}", "listingPage.listTracks.withSheetMusicFiles.title": "Tracks - with Sheet Music Files", "listingPage.listTracks.withSheetMusicFiles.title.short": "...with Sheet Music Files", - "listingPage.listTracks.withSheetMusicFiles.chunk.title": "{ALBUM} ({DATE})", + "listingPage.listTracks.withSheetMusicFiles.chunk.title": "{ALBUM}", + "listingPage.listTracks.withSheetMusicFiles.chunk.title.withDate": "{ALBUM} ({DATE})", "listingPage.listTracks.withSheetMusicFiles.chunk.item": "{TRACK}", "listingPage.listTracks.withMidiProjectFiles.title": "Tracks - with MIDI & Project Files", "listingPage.listTracks.withMidiProjectFiles.title.short": "...with MIDI & Project Files", - "listingPage.listTracks.withMidiProjectFiles.chunk.title": "{ALBUM} ({DATE})", + "listingPage.listTracks.withMidiProjectFiles.chunk.title": "{ALBUM}", + "listingPage.listTracks.withMidiProjectFiles.chunk.title.withDate": "{ALBUM} ({DATE})", "listingPage.listTracks.withMidiProjectFiles.chunk.item": "{TRACK}", "listingPage.listTags.byName.title": "Tags - by Name", "listingPage.listTags.byName.title.short": "...by Name", -- cgit 1.3.0-6-gf8a5