Map SAB storage root safely
Only treat configured manual storage as Importarr-owned and map SAB container paths to local paths.
This commit is contained in:
@@ -28,6 +28,30 @@ def test_wrong_category_outside_root_ignored():
|
||||
assert result.state == "ignored"
|
||||
|
||||
|
||||
def test_sab_storage_root_maps_to_local_download_root():
|
||||
result = classify_history_item(
|
||||
item(category="*", storage="/data/downloads/manual/Movie"),
|
||||
set(),
|
||||
"manual",
|
||||
ROOT,
|
||||
sab_storage_root=Path("/data/downloads/manual"),
|
||||
)
|
||||
assert result.ready
|
||||
assert result.storage == ROOT / "Movie"
|
||||
|
||||
|
||||
def test_radarr_sonarr_storage_roots_are_not_importarr_owned():
|
||||
for storage in ("/data/downloads/movies/Movie", "/data/downloads/tv/Show"):
|
||||
result = classify_history_item(
|
||||
item(category="*", storage=storage),
|
||||
set(),
|
||||
"manual",
|
||||
ROOT,
|
||||
sab_storage_root=Path("/data/downloads/manual"),
|
||||
)
|
||||
assert result.state == "ignored"
|
||||
|
||||
|
||||
def test_sab_cat_field_is_treated_as_category():
|
||||
result = classify_history_item(item(category=None, cat="manual"), set(), "manual", ROOT)
|
||||
assert result.ready
|
||||
|
||||
Reference in New Issue
Block a user