fix in queue

This commit is contained in:
Mateusz Gruszczyński
2026-05-05 11:07:54 +02:00
parent eb3d743500
commit dc78f8fd38
5 changed files with 38 additions and 8 deletions

View File

@@ -909,7 +909,11 @@ def smart_queue_check():
if not profile:
return ok({'result': {'ok': False, 'error': 'No profile'}})
try:
return ok({'result': smart_queue.check(profile, force=True)})
result = smart_queue.check(profile, force=True)
# Note: Ręczny check zwraca od razu świeży snapshot, żeby UI pokazało realną liczbę Downloading po akcji.
diff = torrent_cache.refresh(profile)
rows = torrent_cache.snapshot(profile['id'])
return ok({'result': result, 'torrent_patch': {**diff, 'summary': cached_summary(profile['id'], rows, force=True)}})
except Exception as exc:
return jsonify({'ok': False, 'error': str(exc)}), 500