From 1f0924cc94ea10320afe951a2e8fb4906b5e6106 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 1 Mar 2023 16:04:50 -0400 Subject: Tracks - with Sheet Music / MIDI & Project Files listings --- src/listing-spec.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ src/strings-default.json | 8 ++++++ 2 files changed, 76 insertions(+) (limited to 'src') diff --git a/src/listing-spec.js b/src/listing-spec.js index ef51fe90..29b7645c 100644 --- a/src/listing-spec.js +++ b/src/listing-spec.js @@ -825,6 +825,74 @@ const listingSpec = [ ])), }, + { + directory: 'tracks/with-sheet-music-files', + stringsKey: 'listTracks.withSheetMusicFiles', + + data: ({wikiData: {albumData}}) => + albumData + .map(album => ({ + album, + tracks: album.tracks.filter(t => !empty(t.sheetMusicFiles)), + })) + .filter(({tracks}) => !empty(tracks)), + + html: (data, {html, language, link}) => + html.tag('dl', + data.flatMap(({album, tracks}) => [ + html.tag('dt', + {class: 'content-heading'}, + language.$('listingPage.listTracks.withSheetMusicFiles.album', { + album: link.album(album), + date: language.formatDate(album.date), + })), + + html.tag('dd', + html.tag('ul', + tracks.map(track => + html.tag('li', + language.$('listingPage.listTracks.withSheetMusicFiles.track', { + track: link.track(track, { + hash: 'sheet-music-files', + }), + }))))), + ])), + }, + + { + directory: 'tracks/with-midi-project-files', + stringsKey: 'listTracks.withMidiProjectFiles', + + data: ({wikiData: {albumData}}) => + albumData + .map(album => ({ + album, + tracks: album.tracks.filter(t => !empty(t.midiProjectFiles)), + })) + .filter(({tracks}) => !empty(tracks)), + + html: (data, {html, language, link}) => + html.tag('dl', + data.flatMap(({album, tracks}) => [ + html.tag('dt', + {class: 'content-heading'}, + language.$('listingPage.listTracks.withMidiProjectFiles.album', { + album: link.album(album), + date: language.formatDate(album.date), + })), + + html.tag('dd', + html.tag('ul', + tracks.map(track => + html.tag('li', + language.$('listingPage.listTracks.withMidiProjectFiles.track', { + track: link.track(track, { + hash: 'midi-project-files', + }), + }))))), + ])), + }, + { directory: 'tags/by-name', stringsKey: 'listTags.byName', diff --git a/src/strings-default.json b/src/strings-default.json index 97be1f02..0c775e34 100644 --- a/src/strings-default.json +++ b/src/strings-default.json @@ -390,6 +390,14 @@ "listingPage.listTracks.withLyrics.title.short": "...with Lyrics", "listingPage.listTracks.withLyrics.album": "{ALBUM} ({DATE})", "listingPage.listTracks.withLyrics.track": "{TRACK}", + "listingPage.listTracks.withSheetMusicFiles.title": "Tracks - with Sheet Music Files", + "listingPage.listTracks.withSheetMusicFiles.title.short": "...with Sheet Music Files", + "listingPage.listTracks.withSheetMusicFiles.album": "{ALBUM} ({DATE})", + "listingPage.listTracks.withSheetMusicFiles.track": "{TRACK}", + "listingPage.listTracks.withMidiProjectFiles.title": "Tracks - with MIDI & Project Files", + "listingPage.listTracks.withMidiProjectFiles.title.short": "...with MIDI & Project Files", + "listingPage.listTracks.withMidiProjectFiles.album": "{ALBUM} ({DATE})", + "listingPage.listTracks.withMidiProjectFiles.track": "{TRACK}", "listingPage.listTags.byName.title": "Tags - by Name", "listingPage.listTags.byName.title.short": "...by Name", "listingPage.listTags.byName.item": "{TAG} ({TIMES_USED})", -- cgit 1.3.0-6-gf8a5