summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvitiko98 <[email protected]>2022-06-21 01:44:24 -0400
committervitiko98 <[email protected]>2022-06-21 01:44:24 -0400
commit14153d7688fcd7f00bd6f02f155308cd18050ac3 (patch)
tree8073dc2795c99ca60380972672d3463fcb8f12e5
parent696becbeb174aa06c905a99171c84fb985e9887a (diff)
downloadbazarr-1.0.5-beta.31.tar.gz
bazarr-1.0.5-beta.31.zip
Subdivx provider: avoid TypeErrorv1.0.5-beta.31
-rw-r--r--libs/subliminal_patch/providers/subdivx.py12
-rw-r--r--tests/subliminal_patch/test_subdivx.py10
2 files changed, 17 insertions, 5 deletions
diff --git a/libs/subliminal_patch/providers/subdivx.py b/libs/subliminal_patch/providers/subdivx.py
index 11beeb722..be72ff052 100644
--- a/libs/subliminal_patch/providers/subdivx.py
+++ b/libs/subliminal_patch/providers/subdivx.py
@@ -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)
diff --git a/tests/subliminal_patch/test_subdivx.py b/tests/subliminal_patch/test_subdivx.py
index 7dc77941f..ae9676aee 100644
--- a/tests/subliminal_patch/test_subdivx.py
+++ b/tests/subliminal_patch/test_subdivx.py
@@ -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)]
)