smart queue fix
This commit is contained in:
@@ -368,13 +368,14 @@ def _cleanup_auto_labels(client: Any, profile_id: int, torrents: list[dict[str,
|
||||
|
||||
|
||||
def _is_running_download_slot(t: dict[str, Any]) -> bool:
|
||||
"""Return True only for incomplete torrents that are currently allowed to run."""
|
||||
# Note: Samo state=1 nie wystarcza, bo d.pause w rTorrent zostawia state=1.
|
||||
# Poprzednia logika traktowała pauzowane torrenty jako aktywne sloty, przez co Smart Queue
|
||||
# nie dobijał do targetu i nie wybierał ich jako kandydatów do wznowienia.
|
||||
"""Return True for incomplete torrents that already occupy a Smart Queue slot."""
|
||||
# Note: Limit Smart Queue oznacza docelową liczbę slotów włączonych do pobierania.
|
||||
# rTorrent często pokazuje d.is_active=0 dla torrentów bez chwilowego transferu, więc slot liczymy
|
||||
# po d.state=1. Techniczny label Smart Queue jest wyjątkiem: oznacza pozycję oczekującą/pauzowaną,
|
||||
# której nie wolno liczyć jako aktywnej. Dzięki temu przy limicie 100 i 82 slotach dobieramy 18.
|
||||
if int(t.get('complete') or 0):
|
||||
return False
|
||||
if bool(t.get('paused')) or str(t.get('status') or '').lower() == 'paused':
|
||||
if str(t.get('label') or '') == SMART_QUEUE_LABEL:
|
||||
return False
|
||||
if str(t.get('status') or '').lower() == 'checking':
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user