move to anther profile

This commit is contained in:
Mateusz Gruszczyński
2026-06-20 17:01:48 +02:00
parent e6733d6a27
commit fc03b7755b
12 changed files with 201 additions and 14 deletions
+4 -1
View File
@@ -408,7 +408,8 @@ def _automation_profile_transfer_payload(profile: dict[str, Any], eff: dict[str,
if not target_profile:
raise ValueError('Automation target profile does not exist')
default_path = _safe_remote_path(rtorrent.default_download_path(target_profile))
target_path = _safe_remote_path(str(eff.get('target_path') or eff.get('path') or default_path))
requested_target_path = _safe_remote_path(str(eff.get('target_path') or eff.get('path') or ''))
target_path = requested_target_path or default_path
roots = [default_path]
try:
prefs = get_disk_monitor_preferences(target_id, user_id=user_id)
@@ -423,6 +424,8 @@ def _automation_profile_transfer_payload(profile: dict[str, Any], eff: dict[str,
pass
target_roots = [r for r in roots if r]
if not any(_path_inside_root(target_path, root) for root in target_roots):
if requested_target_path:
raise ValueError('Automation target path is outside the target profile download roots')
target_path = default_path
requested_move_data = bool(eff.get('move_data'))
move_data = False