diff options
author | Vitiko <[email protected]> | 2022-10-26 23:56:21 -0400 |
---|---|---|
committer | Vitiko <[email protected]> | 2022-10-27 00:00:19 -0400 |
commit | 122398fdc869c1c9bb3aa092f6997db85da26925 (patch) | |
tree | 8ca3a57660cf0b1a0635ac095f8dc3a81a2c747c | |
parent | 876b42bb8f8db9e16364d597162e987481978e36 (diff) | |
download | bazarr-122398fdc869c1c9bb3aa092f6997db85da26925.tar.gz bazarr-122398fdc869c1c9bb3aa092f6997db85da26925.zip |
Subf2m Provider: add support for complete series packsv1.1.3-beta.8
-rw-r--r-- | libs/subliminal_patch/providers/subf2m.py | 8 | ||||
-rw-r--r-- | tests/subliminal_patch/test_subf2m.py | 21 |
2 files changed, 26 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/subf2m.py b/libs/subliminal_patch/providers/subf2m.py index 17f32a902..0fab14c98 100644 --- a/libs/subliminal_patch/providers/subf2m.py +++ b/libs/subliminal_patch/providers/subf2m.py @@ -272,8 +272,12 @@ class Subf2mProvider(Provider): guess = _memoized_episode_guess(clean_text) if "season" not in guess: - logger.debug("Nothing guessed from release: %s", clean_text) - continue + 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) + continue if season in guess["season"] and episode in guess.get("episode", []): logger.debug("Episode match found: %s - %s", guess, clean_text) diff --git a/tests/subliminal_patch/test_subf2m.py b/tests/subliminal_patch/test_subf2m.py index 5db7d290e..5846971b3 100644 --- a/tests/subliminal_patch/test_subf2m.py +++ b/tests/subliminal_patch/test_subf2m.py @@ -63,7 +63,7 @@ def test_find_episode_subtitles(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" with Subf2mProvider() as provider: @@ -73,6 +73,25 @@ def test_fint_episode_subtitles_from_complete_series_path(episodes): 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 def subtitle(): release_info = """Dune-2021.All.WEBDLL |