mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 05:25:28 +00:00
Subf2m Provider: add support for complete series packs
This commit is contained in:
parent
876b42bb8f
commit
122398fdc8
2 changed files with 26 additions and 3 deletions
|
@ -272,6 +272,10 @@ class Subf2mProvider(Provider):
|
||||||
guess = _memoized_episode_guess(clean_text)
|
guess = _memoized_episode_guess(clean_text)
|
||||||
|
|
||||||
if "season" not in guess:
|
if "season" not in guess:
|
||||||
|
if "complete series" in clean_text.lower():
|
||||||
|
logger.debug("Complete series pack found: %s", clean_text)
|
||||||
|
guess["season"] = [season]
|
||||||
|
else:
|
||||||
logger.debug("Nothing guessed from release: %s", clean_text)
|
logger.debug("Nothing guessed from release: %s", clean_text)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ def test_find_episode_subtitles(language):
|
||||||
assert sub.language == language
|
assert sub.language == language
|
||||||
|
|
||||||
|
|
||||||
def test_fint_episode_subtitles_from_complete_series_path(episodes):
|
def test_find_episode_subtitles_from_complete_series_path():
|
||||||
path = "/subtitles/courage-the-cowardly-dog"
|
path = "/subtitles/courage-the-cowardly-dog"
|
||||||
|
|
||||||
with Subf2mProvider() as provider:
|
with Subf2mProvider() as provider:
|
||||||
|
@ -73,6 +73,25 @@ def test_fint_episode_subtitles_from_complete_series_path(episodes):
|
||||||
assert sub.language == Language.fromalpha2("en")
|
assert sub.language == Language.fromalpha2("en")
|
||||||
|
|
||||||
|
|
||||||
|
def test_list_and_download_subtitles_complete_series_pack(episodes):
|
||||||
|
episode = list(episodes.values())[0]
|
||||||
|
|
||||||
|
episode.series = "Sam & Max: Freelance Police"
|
||||||
|
episode.name = "The Glazed McGuffin Affair"
|
||||||
|
episode.title = "The Glazed McGuffin Affair"
|
||||||
|
episode.season = 1
|
||||||
|
episode.episode = 21
|
||||||
|
|
||||||
|
with Subf2mProvider() as provider:
|
||||||
|
subtitles = provider.list_subtitles(episode, {Language.fromalpha2("en")})
|
||||||
|
assert subtitles
|
||||||
|
|
||||||
|
subtitle = subtitles[0]
|
||||||
|
provider.download_subtitle(subtitle)
|
||||||
|
|
||||||
|
assert subtitle.is_valid()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def subtitle():
|
def subtitle():
|
||||||
release_info = """Dune-2021.All.WEBDLL
|
release_info = """Dune-2021.All.WEBDLL
|
||||||
|
|
Loading…
Reference in a new issue