Fix permission error when copying files to network directory

- Replace shutil.copy2() with shutil.copyfile() in enhanced_provider.py
- Replace shutil.copy() with shutil.copyfile() in aniworld_provider.py
- copyfile() only copies content, avoiding metadata permission issues
This commit is contained in:
2026-01-09 19:18:57 +01:00
parent 489c37357e
commit 2a85a2bc18
3 changed files with 36 additions and 2 deletions

View File

@@ -326,7 +326,8 @@ class AniworldLoader(Loader):
if os.path.exists(temp_path):
logging.debug("Moving file from temp to final destination")
shutil.copy(temp_path, output_path)
# Use copyfile instead of copy to avoid metadata permission issues
shutil.copyfile(temp_path, output_path)
os.remove(temp_path)
logging.info(
f"Download completed successfully: {output_file}"

View File

@@ -555,7 +555,8 @@ class EnhancedAniWorldLoader(Loader):
# Verify downloaded file
if file_corruption_detector.is_valid_video_file(temp_path):
# Move to final location
shutil.copy2(temp_path, output_path)
# Use copyfile instead of copy2 to avoid metadata permission issues
shutil.copyfile(temp_path, output_path)
# Calculate and store checksum for integrity
integrity_mgr = get_integrity_manager()