fix: case-insensitive title filter + scan before playlist creation

backend: replace title *= (case-sensitive) with title ~= (?i) regex so
"MEMORIES" and "Echoes of Eternity" match regardless of YT title casing.
Refactor buildTitleKeyword → buildTitleKeywords returning array.

frontend: trigger Navidrome startScan after download completes and wait
for scan to finish before running _createNdPlaylist, so newly downloaded
tracks are indexed and searchable when the playlist is built.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-02 13:40:20 +02:00
1 parent 42658b3cbf
commit 7a0a7ca455
2 files changed
+26 -12

No files matched your search

+12
View File
@@ -344,6 +344,18 @@ async function _pollAndCreatePlaylist(jobId, tracks, playlistName) {
if (!job || job.status === 'done' || job.status === 'error') break;
}
if (S.jobs[jobId]?.status !== 'done') return;
// Trigger Navidrome library scan so newly downloaded files are indexed before searching
try {
await api('startScan', '');
toast('🔍 Navidrome scannt Bibliothek…');
for (let i = 0; i < 90; i++) {
await new Promise(r => setTimeout(r, 2000));
const st = await api('getScanStatus', '');
if (!st?.scanStatus?.scanning) break;
}
} catch { /* scan API unavailable — proceed anyway */ }
await _createNdPlaylist(tracks, playlistName);
}