fix: remove artist filter + fix playlist scan timing

backend: drop unreliable artist *= filter entirely — yt-dlp artist field
is empty for many label-distributed YTM tracks (NoAki, etc.), causing
correct results to be rejected in Steps 1-2 and falling through to Step 3
anyway. Search query already targets the right artist; title keyword +
duration are sufficient. Simplifies cascade from 8→8 steps but with fewer
wasted filter attempts.

frontend: add 3s delay before polling getScanStatus (gives Navidrome time
to actually start the scan), and 5s buffer after scan completes (lets DB
writes settle). Fallback to 30s fixed wait if scan API is unavailable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-02 14:15:09 +02:00
1 parent 7a0a7ca455
commit 0a7591a690
2 files changed
+40 -33

No files matched your search

+9 -2
View File
@@ -345,16 +345,23 @@ async function _pollAndCreatePlaylist(jobId, tracks, playlistName) {
}
if (S.jobs[jobId]?.status !== 'done') return;
// Trigger Navidrome library scan so newly downloaded files are indexed before searching
// Trigger Navidrome library scan so newly downloaded files are indexed before searching.
// Initial 3s delay lets the scan actually start before we poll.
// 5s buffer after completion lets DB writes settle before we search.
// If scan API fails entirely, fall back to a 30s fixed wait.
try {
await api('startScan', '');
toast('🔍 Navidrome scannt Bibliothek…');
await new Promise(r => setTimeout(r, 3000));
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 new Promise(r => setTimeout(r, 5000));
} catch {
await new Promise(r => setTimeout(r, 30000));
}
await _createNdPlaylist(tracks, playlistName);
}