mirror of https://github.com/morpheus65535/bazarr
Fix TypeError
This commit is contained in:
parent
5f858cc91d
commit
99a3abb240
|
@ -103,16 +103,18 @@ class SuchaProvider(Provider):
|
|||
)
|
||||
res.raise_for_status()
|
||||
result = res.json()
|
||||
|
||||
try:
|
||||
subtitles = []
|
||||
for i in result:
|
||||
matches = set()
|
||||
try:
|
||||
if (
|
||||
video.title.lower() in i["title"].lower()
|
||||
or video.title.lower() in i["alt_title"].lower()
|
||||
):
|
||||
matches.add("title")
|
||||
except TypeError:
|
||||
logger.debug("No subtitles found")
|
||||
return []
|
||||
if is_episode:
|
||||
if (
|
||||
q["query"].lower() in i["title"].lower()
|
||||
|
@ -136,9 +138,6 @@ class SuchaProvider(Provider):
|
|||
)
|
||||
)
|
||||
return subtitles
|
||||
except KeyError:
|
||||
logger.debug("No subtitles found")
|
||||
return []
|
||||
|
||||
def list_subtitles(self, video, languages):
|
||||
return self.query(languages, video)
|
||||
|
|
Loading…
Reference in New Issue