mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-12-27 09:36:06 +08:00
Subdivx provider: avoid TypeError
This commit is contained in:
parent
696becbeb1
commit
14153d7688
2 changed files with 17 additions and 5 deletions
|
@ -42,12 +42,14 @@ class SubdivxSubtitle(Subtitle):
|
|||
language, hearing_impaired=False, page_link=page_link
|
||||
)
|
||||
self.video = video
|
||||
self.title = title
|
||||
|
||||
self.download_url = download_url
|
||||
self.description = description
|
||||
self.uploader = uploader
|
||||
self.release_info = self.title
|
||||
if self.description and self.description.strip():
|
||||
|
||||
self.release_info = str(title)
|
||||
self.description = str(description).strip()
|
||||
|
||||
if self.description:
|
||||
self.release_info += " | " + self.description
|
||||
|
||||
@property
|
||||
|
@ -124,7 +126,7 @@ class SubdivxSubtitlesProvider(Provider):
|
|||
"masdesc": "",
|
||||
"subtitulos": "1",
|
||||
"realiza_b": "1",
|
||||
"pg": "1",
|
||||
"pg": 1,
|
||||
}
|
||||
logger.debug("Query: %s", query)
|
||||
|
||||
|
|
|
@ -26,6 +26,16 @@ def test_list_subtitles_movie_with_year_fallback(movies):
|
|||
assert provider.list_subtitles(item, {Language("spa", "MX")})
|
||||
|
||||
|
||||
def test_handle_multi_page_search(episodes):
|
||||
with SubdivxSubtitlesProvider() as provider:
|
||||
subs = list(
|
||||
provider._handle_multi_page_search(
|
||||
"Game Of Thrones", episodes["got_s03e10"]
|
||||
)
|
||||
)
|
||||
assert len(subs) > 100
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"episode_key,expected", [("breaking_bad_s01e01", 15), ("inexistent", 0)]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue