dev #66
+19
-2
@@ -786,10 +786,27 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
||||
movie_skipped = 0
|
||||
movie_processed = 0
|
||||
|
||||
def translate_host_path_to_container(path_str):
|
||||
"""Translate host paths to container paths for Docker volume mounts"""
|
||||
path_str = str(path_str)
|
||||
# Handle the common Docker volume mount: /mnt/unionfs/Media/ -> /media/
|
||||
if path_str.startswith('/mnt/unionfs/Media/'):
|
||||
container_path = path_str.replace('/mnt/unionfs/Media/', '/media/')
|
||||
print(f"DEBUG: Translated host path '{path_str}' to container path '{container_path}'")
|
||||
return container_path
|
||||
# Handle case where user enters /Media/ instead of /media/ (case sensitivity)
|
||||
elif path_str.startswith('/Media/'):
|
||||
container_path = path_str.replace('/Media/', '/media/')
|
||||
print(f"DEBUG: Fixed case sensitivity '{path_str}' to container path '{container_path}'")
|
||||
return container_path
|
||||
return path_str
|
||||
|
||||
paths_to_scan = []
|
||||
if path:
|
||||
paths_to_scan = [Path(path)]
|
||||
print(f"DEBUG: Manual scan with specific path: {path}")
|
||||
# Translate the provided path from host format to container format
|
||||
translated_path = translate_host_path_to_container(path)
|
||||
paths_to_scan = [Path(translated_path)]
|
||||
print(f"DEBUG: Manual scan with specific path: {path} -> {translated_path}")
|
||||
else:
|
||||
if scan_type in ["both", "tv"]:
|
||||
paths_to_scan.extend(config.tv_paths)
|
||||
|
||||
Reference in New Issue
Block a user