Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67efdedb51 |
@@ -33,6 +33,15 @@ def _max_polls(total_bytes: int) -> int:
|
||||
return max(_MIN_XFER_POLLS, min(budget, _MAX_XFER_POLLS))
|
||||
|
||||
|
||||
def _needs_enqueue(state: str) -> bool:
|
||||
"""Whether a file must be (re)enqueued on slskd. True if it has no transfer yet or its last
|
||||
transfer ended badly (Errored/Cancelled/Rejected); a file already Completed/InProgress/Queued is
|
||||
left alone so a resumed download continues it instead of restarting from zero. Pure — unit-tested."""
|
||||
if not state:
|
||||
return True
|
||||
return any(bad in state for bad in ("Errored", "Cancelled", "Rejected"))
|
||||
|
||||
|
||||
def _basename(path: str) -> str:
|
||||
return path.rsplit("\\", 1)[-1].rsplit("/", 1)[-1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user