mobile ux

This commit is contained in:
Mateusz Gruszczyński
2026-05-08 18:29:56 +02:00
parent 76412284bb
commit d5d41bcec2
7 changed files with 178 additions and 15 deletions

View File

@@ -484,6 +484,22 @@ def torrents():
})
@bp.get("/trackers/summary")
def trackers_summary():
profile = preferences.active_profile()
if not profile:
return ok({"summary": {"hashes": {}, "trackers": [], "errors": [], "scanned": 0}, "error": "No profile"})
limit = min(2000, max(1, int(request.args.get("limit") or 1000)))
hashes = request.args.getlist("hash")
try:
# Note: This endpoint powers only the sidebar tracker filter and never mutates torrents.
if not hashes:
hashes = [t.get("hash") for t in torrent_cache.snapshot(profile["id"]) if t.get("hash")]
return ok({"summary": rtorrent.tracker_summary(profile, hashes, limit=limit)})
except Exception as exc:
return jsonify({"ok": False, "error": str(exc)}), 500
@bp.get("/torrent-stats")
def torrent_stats_get():
profile = preferences.active_profile()