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'.
This commit is contained in:
Broque Thomas 2026-04-18 18:19:49 -07:00
parent 2c15d50bff
commit 6036e02011
2 changed files with 5 additions and 5 deletions

View file

@ -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}")

View file

@ -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');