no log: add providers utility

pull/1853/head
vitiko98 2 years ago
parent fde1e0e069
commit d3e5dc34d7

@ -82,6 +82,10 @@ def get_subtitle_from_archive(
return None
def is_episode(content):
return "episode" in guessit(content, {"type": "episode"})
def get_archive_from_bytes(content: bytes):
"""Get RarFile/ZipFile object from bytes. Return None is something else
is found."""

@ -53,3 +53,10 @@ def test_update_matches(movies):
matches, movies["dune"], "Subs for dune 2021 bluray x264\nDune webrip x264"
)
assert "source" in matches
@pytest.mark.parametrize(
"content,expected", [("the.wire.s01e01", True), ("taxi driver 1976", False)]
)
def test_is_episode(content, expected):
assert utils.is_episode(content) is expected

Loading…
Cancel
Save