mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 00:03:33 +00:00
no log: add providers utility
This commit is contained in:
parent
fde1e0e069
commit
d3e5dc34d7
2 changed files with 11 additions and 0 deletions
|
@ -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…
Reference in a new issue