fix: reduce playlist creation wait time after Spotify import

Cap Navidrome scan poll from 3 min to 60s, shrink post-scan buffer from 5s to 3s, and error fallback from 30s to 20s — playlist now appears sooner after downloads complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-03 02:11:04 +02:00
1 parent 8f8c38fcf0
commit 7b92cf7444
1 file changed
+3 -3
+3 -3
View File
@@ -357,14 +357,14 @@ async function _pollAndCreatePlaylist(jobId, tracks, playlistName) {
await api('startScan', ''); await api('startScan', '');
toast('🔍 Navidrome scannt Bibliothek…'); toast('🔍 Navidrome scannt Bibliothek…');
await new Promise(r => setTimeout(r, 3000)); await new Promise(r => setTimeout(r, 3000));
for (let i = 0; i < 90; i++) { for (let i = 0; i < 30; i++) {
await new Promise(r => setTimeout(r, 2000)); await new Promise(r => setTimeout(r, 2000));
const st = await api('getScanStatus', ''); const st = await api('getScanStatus', '');
if (!st?.scanStatus?.scanning) break; if (!st?.scanStatus?.scanning) break;
} }
await new Promise(r => setTimeout(r, 5000)); await new Promise(r => setTimeout(r, 3000));
} catch { } catch {
await new Promise(r => setTimeout(r, 30000)); await new Promise(r => setTimeout(r, 20000));
} }
await _createNdPlaylist(tracks, playlistName); await _createNdPlaylist(tracks, playlistName);