diff --git a/app.py b/app.py index 801b730..39ffeb8 100644 --- a/app.py +++ b/app.py @@ -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: diff --git a/templates/index.html b/templates/index.html index 7f09278..26c675e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -100,6 +100,9 @@ const seenRunning={radarr:false,sonarr:false,missing:false};async function poll( document.querySelector('#rescan').onclick=async()=>{const b=document.querySelector('#rescan'),source=document.querySelector('#scanSource').value;sessionStorage.setItem('dashboard-active-view',document.querySelector('.nav button.active')?.dataset.view||'dashboard');b.disabled=true;b.textContent='Scan läuft …';await fetch('/api/rescan?source='+source,{method:'POST'});b.disabled=false;b.textContent='↻ Neu scannen';poll()}; +