From 5a11730ee04f405bb1448f5dd6ae80741067ea78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sun, 24 May 2026 11:24:26 +0200 Subject: [PATCH] harder post-ceheck --- pytorrent/services/rtorrent/torrents.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorrent/services/rtorrent/torrents.py b/pytorrent/services/rtorrent/torrents.py index 489b958..13ab281 100644 --- a/pytorrent/services/rtorrent/torrents.py +++ b/pytorrent/services/rtorrent/torrents.py @@ -149,7 +149,8 @@ def _cleanup_post_check_label_if_ready(c: ScgiRtorrentClient, row: dict) -> bool if POST_CHECK_DOWNLOAD_LABEL not in labels: return False status = str(row.get("status") or "").lower() - started_after_wait = bool(int(row.get("state") or 0)) and status != "checking" + # Note: rTorrent may report state=1 after a recheck even when the download is not really active yet. + started_after_wait = bool(int(row.get("state") or 0)) and bool(int(row.get("active") or 0)) and status != "checking" if not (_row_progress_complete(row) or status == "seeding" or started_after_wait): return False # Note: Keep the post-check label while the torrent is stopped; remove it once it is started for download/seeding.