move to anther profile
This commit is contained in:
@@ -289,6 +289,12 @@ def _emit_disk_refresh_requested(profile_id: int, action_name: str, payload: dic
|
||||
_schedule_profile_disk_refresh(int(profile_id), len((payload or {}).get("hashes") or []))
|
||||
|
||||
def _execute(profile: dict, action_name: str, payload: dict, user_id: int | None = None):
|
||||
def checkpoint(next_state: dict, current: int, total: int):
|
||||
# Note: Checkpoint is defined before every action branch so profile-transfer jobs can resume safely.
|
||||
job_id = payload.get("__job_id")
|
||||
if job_id:
|
||||
_checkpoint_job(str(job_id), next_state, current, total)
|
||||
|
||||
if action_name == "smart_queue_check":
|
||||
from . import smart_queue
|
||||
return smart_queue.check(profile, user_id=user_id or default_user_id(), force=True)
|
||||
@@ -315,11 +321,6 @@ def _execute(profile: dict, action_name: str, payload: dict, user_id: int | None
|
||||
disk_guard.assert_can_start_download(profile)
|
||||
state = payload.get("__resume_state") or {}
|
||||
|
||||
def checkpoint(next_state: dict, current: int, total: int):
|
||||
job_id = payload.get("__job_id")
|
||||
if job_id:
|
||||
_checkpoint_job(str(job_id), next_state, current, total)
|
||||
|
||||
return rtorrent.action(profile, hashes, action_name, payload, checkpoint=checkpoint, resume_state=state)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user