From 6036e020110ce4af1d026ecf0e464bdd4fe56d74 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sat, 18 Apr 2026 18:19:49 -0700 Subject: [PATCH] Fix library scan button stuck on 'Stop' and stale count shown as 'failed' Dashboard scan polling checked for 'completed' but backend sets 'finished'. Added 'finished' to the completion check so polling stops, button resets, stats refresh, and toast fires correctly. Also fixed deep scan reporting stale record removals as 'failed' instead of 'successful'. --- web_server.py | 2 +- webui/static/script.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web_server.py b/web_server.py index d4bbf0c8..3dccd0b3 100644 --- a/web_server.py +++ b/web_server.py @@ -24628,7 +24628,7 @@ def _run_soulsync_deep_scan(): print(f"[SoulSync Deep Scan] {summary}") add_activity_item("", "SoulSync Deep Scan", summary, "Now") - _db_update_finished_callback(0, 0, len(transfer_files), moved_count, stale_count) + _db_update_finished_callback(0, 0, len(transfer_files), moved_count + stale_count, 0) except Exception as e: print(f"[SoulSync Deep Scan] Error: {e}") diff --git a/webui/static/script.js b/webui/static/script.js index 0f8e6ef3..375bbf24 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -25526,11 +25526,11 @@ async function dashboardLibraryScan(fullRefresh = false) { detail.textContent = `${status.processed} / ${status.total || '?'}`; } - if (status.status === 'completed' || status.status === 'error' || status.status === 'idle') { + if (status.status === 'completed' || status.status === 'finished' || status.status === 'error' || status.status === 'idle') { clearInterval(pollInterval); window._libraryStatusScanning = false; - if (status.status === 'completed') { + if (status.status === 'completed' || status.status === 'finished') { showToast('Library scan complete', 'success'); } else if (status.status === 'error') { showToast(`Scan error: ${status.error_message || 'Unknown'}`, 'error'); @@ -25608,11 +25608,11 @@ async function dashboardLibraryDeepScan() { detail.textContent = `${status.processed} / ${status.total || '?'}`; } - if (status.status === 'completed' || status.status === 'error' || status.status === 'idle') { + if (status.status === 'completed' || status.status === 'finished' || status.status === 'error' || status.status === 'idle') { clearInterval(pollInterval); window._libraryStatusScanning = false; - if (status.status === 'completed') { + if (status.status === 'completed' || status.status === 'finished') { showToast('Deep scan complete', 'success'); } else if (status.status === 'error') { showToast(`Deep scan error: ${status.error_message || 'Unknown'}`, 'error');