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:
parent
2c15d50bff
commit
6036e02011
2 changed files with 5 additions and 5 deletions
|
|
@ -24628,7 +24628,7 @@ def _run_soulsync_deep_scan():
|
||||||
|
|
||||||
print(f"[SoulSync Deep Scan] {summary}")
|
print(f"[SoulSync Deep Scan] {summary}")
|
||||||
add_activity_item("", "SoulSync Deep Scan", summary, "Now")
|
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:
|
except Exception as e:
|
||||||
print(f"[SoulSync Deep Scan] Error: {e}")
|
print(f"[SoulSync Deep Scan] Error: {e}")
|
||||||
|
|
|
||||||
|
|
@ -25526,11 +25526,11 @@ async function dashboardLibraryScan(fullRefresh = false) {
|
||||||
detail.textContent = `${status.processed} / ${status.total || '?'}`;
|
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);
|
clearInterval(pollInterval);
|
||||||
window._libraryStatusScanning = false;
|
window._libraryStatusScanning = false;
|
||||||
|
|
||||||
if (status.status === 'completed') {
|
if (status.status === 'completed' || status.status === 'finished') {
|
||||||
showToast('Library scan complete', 'success');
|
showToast('Library scan complete', 'success');
|
||||||
} else if (status.status === 'error') {
|
} else if (status.status === 'error') {
|
||||||
showToast(`Scan error: ${status.error_message || 'Unknown'}`, 'error');
|
showToast(`Scan error: ${status.error_message || 'Unknown'}`, 'error');
|
||||||
|
|
@ -25608,11 +25608,11 @@ async function dashboardLibraryDeepScan() {
|
||||||
detail.textContent = `${status.processed} / ${status.total || '?'}`;
|
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);
|
clearInterval(pollInterval);
|
||||||
window._libraryStatusScanning = false;
|
window._libraryStatusScanning = false;
|
||||||
|
|
||||||
if (status.status === 'completed') {
|
if (status.status === 'completed' || status.status === 'finished') {
|
||||||
showToast('Deep scan complete', 'success');
|
showToast('Deep scan complete', 'success');
|
||||||
} else if (status.status === 'error') {
|
} else if (status.status === 'error') {
|
||||||
showToast(`Deep scan error: ${status.error_message || 'Unknown'}`, 'error');
|
showToast(`Deep scan error: ${status.error_message || 'Unknown'}`, 'error');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue