🚑 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
@@ -25,6 +25,7 @@ from app.converter import (
|
||||
import_mkv,
|
||||
link_or_copy,
|
||||
longest_title_id,
|
||||
radarr_to_container_path,
|
||||
sanitize_component,
|
||||
unlink_if_exists,
|
||||
)
|
||||
@@ -109,6 +110,31 @@ def test_import_mkv_copies_when_hardlink_impossible(monkeypatch) -> None:
|
||||
assert source.read_text() == "donnees du mkv"
|
||||
|
||||
|
||||
def test_radarr_to_container_path_strips_stray_spaces() -> None:
|
||||
"""Une espace parasite en tete de chemin (racine Radarr mal saisie) ne
|
||||
doit plus fuiter jusqu'a MakeMKV: le chemin traduit est nettoyé, meme
|
||||
pour une ligne deja stockee en base."""
|
||||
spaced = f" {settings.radarr_films_dir}/Film Test (2025)/Film Test (2025).iso"
|
||||
translated = radarr_to_container_path(spaced)
|
||||
assert translated == settings.films_dir / "Film Test (2025)" / "Film Test (2025).iso"
|
||||
assert not str(translated).startswith(" ")
|
||||
|
||||
|
||||
def test_movie_file_path_strips_stray_spaces() -> None:
|
||||
"""Radarr peut rapporter des chemins avec des espaces parasites: ils
|
||||
sont nettoyes a l'ingestion (champ path ou recomposition)."""
|
||||
assert (
|
||||
movie_file_path({"movieFile": {"path": " /movies/Film (2025).iso"}})
|
||||
== "/movies/Film (2025).iso"
|
||||
)
|
||||
assert (
|
||||
movie_file_path(
|
||||
{"path": " /movies/Film (2025)", "movieFile": {"relativePath": " Film.iso "}}
|
||||
)
|
||||
== "/movies/Film (2025)/Film.iso"
|
||||
)
|
||||
|
||||
|
||||
# --- Traduction des erreurs de fichiers ---
|
||||
def test_file_error_translates_errnos() -> None:
|
||||
error = file_error(
|
||||
|
||||
Reference in new issue
Block a user