import singles: default the Identify search to "artist - title" (dash)

Discord (Shdjfgatdif): the import-singles Identify search prefilled "artist title" (space), so
"Sub Focus Last Jungle" returned junk while "Sub Focus - Last Jungle" found the track. The
placeholder already hints "Search artist - title..."; the prefill just did not match it. Join with
" - " instead of " ". filter(Boolean) keeps a lone title (no artist) dash-free.
This commit is contained in:
BoulderBadgeDad 2026-06-28 15:16:13 -07:00
parent 8abf470018
commit 969700674c

View file

@ -50,7 +50,10 @@ export function SinglesImportTab() {
setOpenSingleSearch(fileKey);
const defaultQuery =
[file?.artist, file?.title].filter(Boolean).join(' ') ||
// "artist - title" (the placeholder hints this, and source search needs the
// dash to disambiguate — "Sub Focus Last Jungle" finds junk, "Sub Focus - Last
// Jungle" finds the track). filter(Boolean) keeps a lone title dash-free.
[file?.artist, file?.title].filter(Boolean).join(' - ') ||
(file?.filename || '').replace(/\.[^.]+$/, '');
ensureSingleSearch(fileKey, defaultQuery);
if (defaultQuery && !singleSearches[fileKey]?.results.length) {