Initial productized Importarr service
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from importarr.scanner import scan_videos
|
||||
|
||||
|
||||
def test_one_row_per_video_with_context(tmp_path):
|
||||
root = tmp_path / "manual"
|
||||
nested = root / "Release.Name" / "hashdir"
|
||||
nested.mkdir(parents=True)
|
||||
(nested / "abc123.mkv").write_bytes(b"x")
|
||||
(nested / "sample.mp4").write_bytes(b"x")
|
||||
rows = scan_videos(root)
|
||||
assert len(rows) == 1
|
||||
assert str(rows[0].relative_path) == "Release.Name/hashdir/abc123.mkv"
|
||||
|
||||
|
||||
def test_transient_folders_ignored(tmp_path):
|
||||
root = tmp_path / "manual"
|
||||
unpack = root / "_UNPACK_Show"
|
||||
unpack.mkdir(parents=True)
|
||||
(unpack / "show.mkv").write_bytes(b"x")
|
||||
assert scan_videos(root) == []
|
||||
Reference in New Issue
Block a user