post-check

This commit is contained in:
Mateusz Gruszczyński
2026-05-24 11:04:42 +02:00
parent 8553615fbf
commit 9caa155324
7 changed files with 47 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ _ERROR_PATTERNS = (
"unreachable",
"denied",
)
_SUMMARY_TYPES = ("all", "downloading", "seeding", "paused", "checking", "error", "stopped")
_SUMMARY_TYPES = ("all", "downloading", "seeding", "paused", "checking", "error", "post_check", "stopped")
_summary_cache: dict[int, dict] = {}
_summary_lock = RLock()
@@ -55,9 +55,12 @@ def _matches(row: dict, summary_type: str) -> bool:
return checking
if summary_type == "error":
return _has_error(row)
if summary_type == "post_check":
# Note: Post-check is counted separately from Stopped so automation can target it safely.
return str(row.get("status") or "") == "Post-check" or bool(row.get("post_check"))
if summary_type == "stopped":
# Note: Stopped count follows the UI filter exactly, so torrents being hash-checked do not inflate an empty Stopped list.
return not checking and not bool(row.get("state"))
# Note: Stopped count follows the UI filter exactly and excludes app-level post-check waiting rows.
return not checking and not bool(row.get("state")) and str(row.get("status") or "") != "Post-check" and not bool(row.get("post_check"))
return False