feat: add library sync status polling with automatic page reload when background sync completes
Add /api/library-status endpoint returning ready/updated_at/error from library_cache with thread-safe lock. Add pollLibrarySync() function to check library status every 5 seconds and reload page when updated_at timestamp changes. Track lastLibrarySync timestamp to detect background sync completion. Save active view to sessionStorage before reload to restore navigation state
This commit is contained in:
@@ -1129,6 +1129,11 @@ def api_rescan():
|
||||
def scan_status():
|
||||
with job_lock: return jsonify(jobs)
|
||||
|
||||
@app.get("/api/library-status")
|
||||
def library_status():
|
||||
with library_cache_lock:
|
||||
return jsonify({"ready": library_cache["ready"], "updated_at": library_cache["updated_at"], "error": library_cache["error"]})
|
||||
|
||||
@app.get("/api/downloads")
|
||||
def downloads():
|
||||
if not SAB_URL or not SAB_API_KEY:
|
||||
|
||||
Reference in New Issue
Block a user