This commit is contained in:
Mateusz Gruszczyński
2026-06-20 17:41:25 +02:00
parent fc03b7755b
commit e1b5822a59
12 changed files with 38 additions and 31 deletions
+3 -3
View File
@@ -842,7 +842,7 @@ def transfer_profile(source_profile: dict, target_profile: dict, torrent_hashes:
target_path = _remote_clean_path(payload.get("target_path") or payload.get("path") or "")
move_data = bool(payload.get("move_data"))
post_action = str(payload.get("post_action") or "none").strip().lower()
if post_action not in {"none", "start", "stop", "pause", "check", "recheck"}:
if post_action not in {"none", "current", "start", "stop", "pause", "check", "recheck"}:
raise ValueError("Unsupported post-transfer action")
label_mode = str(payload.get("label_mode") or "none").strip().lower()
label_value = str(payload.get("label_value") or "").strip()
@@ -902,8 +902,8 @@ def transfer_profile(source_profile: dict, target_profile: dict, torrent_hashes:
move_result = _move_profile_transfer_data(source_client, h, target_path)
item.update(move_result)
moved_to = str(move_result.get("moved_to") or "")
# Note: Explicit post-transfer actions override state restoration and keep command effects predictable.
start_on_target = bool(move_data and (was_state or was_active)) if post_action == "none" else post_action == "start"
# Note: The default keeps the torrent status from the source profile; explicit actions override it.
start_on_target = bool(was_state or was_active) if post_action in {"none", "current"} else post_action == "start"
try:
added = add_torrent_raw(target_profile, data, start_on_target, target_path, target_label)
if not added.get("ok"):