From 3a1aa3d7232ba24725b1b9215c296747bb8b242c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 13 May 2024 09:43:30 -0300 Subject: search, client: album results --- src/content/dependencies/generateSearchSidebarBox.js | 3 +++ src/static/js/client.js | 14 ++++++++++++++ src/strings-default.yaml | 1 + src/util/search-spec.js | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/src/content/dependencies/generateSearchSidebarBox.js b/src/content/dependencies/generateSearchSidebarBox.js index 796cfe28..22c5c773 100644 --- a/src/content/dependencies/generateSearchSidebarBox.js +++ b/src/content/dependencies/generateSearchSidebarBox.js @@ -29,6 +29,9 @@ export default { html.tag('template', {class: 'wiki-search-end-search-string'}, language.$('misc.search.endSearch')), + html.tag('template', {class: 'wiki-search-album-result-kind-string'}, + language.$('misc.search.resultKind.album')), + html.tag('template', {class: 'wiki-search-artist-result-kind-string'}, language.$('misc.search.resultKind.artist')), diff --git a/src/static/js/client.js b/src/static/js/client.js index ceaec460..dab1ea37 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -3590,6 +3590,7 @@ const sidebarSearchInfo = initInfo('sidebarSearchInfo', { currentResultString: null, endSearchString: null, + albumResultKindString: null, artistResultKindString: null, groupResultKindString: null, @@ -3632,6 +3633,9 @@ function getSidebarSearchReferences() { info.endSearchString = findString('end-search'); + info.albumResultKindString = + findString('album-result-kind'); + info.artistResultKindString = findString('artist-result-kind'); @@ -3844,6 +3848,16 @@ function generateSidebarSearchResult(result) { }; switch (result.referenceType) { + case 'album': { + preparedSlots.href = + openAlbum(result.directory); + + preparedSlots.kindString = + info.albumResultKindString; + + break; + } + case 'artist': { preparedSlots.href = openArtist(result.directory); diff --git a/src/strings-default.yaml b/src/strings-default.yaml index a06882c1..23f67ce6 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -630,6 +630,7 @@ misc: endSearch: "(OK, I'm done searching now.)" resultKind: + album: "(album)" artist: "(artist)" group: "(group)" diff --git a/src/util/search-spec.js b/src/util/search-spec.js index 5aba2194..f9d2a035 100644 --- a/src/util/search-spec.js +++ b/src/util/search-spec.js @@ -2,6 +2,14 @@ function getArtworkPath(thing) { switch (thing.constructor[Symbol.for('Thing.referenceType')]) { + case 'album': { + return [ + 'media.albumCover', + thing.directory, + thing.coverArtFileExtension, + ]; + } + case 'flash': { return [ 'media.flashArt', -- cgit 1.3.0-6-gf8a5