🚑 Espace parasite en tete de chemin Radarr: nettoyee a l'ingestion et a la traduction - MakeMKV cherchait un fichier inexistant (cas Coco)
This commit is contained in:
1 parent
1df4daaae5
commit
ddf39b63ef
5 files changed
+72
-5
No files matched your search
+5
-1
@@ -57,8 +57,12 @@ def radarr_to_container_path(path: str) -> Path:
|
||||
(radarr_films_dir); si celui-ci differe du point de montage du conteneur
|
||||
(films_dir), on traduit. Sans radarr_films_dir, les chemins sont pris
|
||||
tels quels (montage "meme chemin").
|
||||
|
||||
Les espaces parasites (tete ou queue) sont ecartees: elles casseraient
|
||||
relative_to — la traduit echouerait et MakeMKV recevrait un chemin
|
||||
« inexistant ». Protege aussi les lignes deja stockees en base.
|
||||
"""
|
||||
iso = Path(path)
|
||||
iso = Path(str(path).strip())
|
||||
radarr_root = settings.radarr_films_dir
|
||||
if radarr_root is not None:
|
||||
try:
|
||||
|
||||
+9
-2
@@ -67,12 +67,19 @@ class RadarrClient:
|
||||
|
||||
|
||||
def movie_file_path(movie: dict) -> str | None:
|
||||
"""Chemin du fichier courant rapporte par Radarr.
|
||||
|
||||
Les espaces parasites (tete surtout — une racine Radarr configuree avec
|
||||
une espace de trop) sont ecartees: elles casseraient silencieusement la
|
||||
traduction de chemin (relative_to echoue) et MakeMKV chercherait un
|
||||
fichier « inexistant ».
|
||||
"""
|
||||
movie_file = movie.get("movieFile") or {}
|
||||
path = movie_file.get("path")
|
||||
if path:
|
||||
return str(path)
|
||||
return str(path).strip()
|
||||
relative_path = movie_file.get("relativePath")
|
||||
movie_path = movie.get("path")
|
||||
if relative_path and movie_path:
|
||||
return str(PurePath(str(movie_path)) / str(relative_path))
|
||||
return str(PurePath(str(movie_path).strip()) / str(relative_path).strip())
|
||||
return None
|
||||
Reference in new issue
Block a user