feat: upload - deel 03
This commit is contained in:
@@ -736,6 +736,8 @@ class SessionService:
|
||||
proposed_filename=proposed_filename,
|
||||
allowed_roots=allowed_roots,
|
||||
)
|
||||
if source_path_str and source_path == destination_path:
|
||||
errors = [err for err in errors if err != "source and destination paths are equal"]
|
||||
|
||||
status = "ready"
|
||||
if errors:
|
||||
@@ -777,17 +779,25 @@ class SessionService:
|
||||
for item in preflight_items:
|
||||
source_path = Path(item["source_path"])
|
||||
destination_path = Path(item["destination_path"])
|
||||
os.replace(str(source_path), str(destination_path))
|
||||
rename_needed = source_path != destination_path
|
||||
|
||||
if rename_needed:
|
||||
os.replace(str(source_path), str(destination_path))
|
||||
target_path = destination_path
|
||||
item_status = "renamed"
|
||||
else:
|
||||
target_path = source_path
|
||||
item_status = "unchanged"
|
||||
|
||||
file_date_status, file_date_detail = self._apply_file_date_after_rename(
|
||||
enabled=set_file_date_to_first_aired,
|
||||
aired_value=aired_by_index.get(int(item["index"])),
|
||||
destination_path=destination_path,
|
||||
destination_path=target_path,
|
||||
)
|
||||
results.append(
|
||||
{
|
||||
**item,
|
||||
"status": "renamed",
|
||||
"status": item_status,
|
||||
"errors": [],
|
||||
"file_date_status": file_date_status,
|
||||
"file_date_detail": file_date_detail,
|
||||
|
||||
Reference in New Issue
Block a user