From aa39ab1317757ba7bbc1851b4b165fe8e18bdfa2 Mon Sep 17 00:00:00 2001 From: HighImKevin Date: Wed, 14 Oct 2026 09:21:47 -0400 Subject: [PATCH] Fix default card format for results on the search page --- scripts/search.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/search.js b/scripts/search.js index 961be6c..ed04a54 100644 --- a/scripts/search.js +++ b/scripts/search.js @@ -214,6 +214,12 @@ }; } + function getSearchCardFormat(itemType) { + if (itemType === 'Episode') return 'Thumb'; + if (itemType === 'MusicArtist' || itemType === 'Audio' || itemType === 'MusicAlbum') return 'Square'; + return null; + } + async function buildSearchSection(itemType, searchTerm, order) { const apiHelper = window.apiHelper; if (!apiHelper?.getQuery || !apiHelper?.buildQueryFromSection) { @@ -234,6 +240,7 @@ }); const termKey = searchTerm.toLowerCase().trim().replace(/[^a-z0-9]+/gi, '-').slice(0, 48); + const cardFormat = getSearchCardFormat(itemType); const sectionConfig = { id: `search-${itemType}-${termKey}`, name: getTypeDisplayName(itemType), @@ -241,7 +248,8 @@ order, queries: [query], ttl: SEARCH_CACHE_TTL, - userConfigurable: false + userConfigurable: false, + ...(cardFormat ? { cardFormat } : {}) }; let mappedDataPromise = null;