Commit 514ebe33 authored by echel0n's avatar echel0n

Fixed issue #SICKRAGE-APP-6RK - 'NoneType' object is not iterable when...

Fixed issue #SICKRAGE-APP-6RK - 'NoneType' object is not iterable when attempting to add and search for a new show
Fixed issue #SICKRAGE-APP-6R4 - 'dict_values' object is not subscriptable
parent 3b01494f
......@@ -86,22 +86,24 @@ class SearchSeriesProviderForShowNameHandler(BaseHandler, ABC):
sickrage.app.log.debug(f"Searching for Show with term: {search_term} on series provider: {series_provider.name}")
# search via series name
for series in series_provider.search(search_term, language=series_provider_language):
if not series.get('seriesname', None):
continue
if not series.get('firstaired', None):
continue
search_results.append((
series_provider.name,
series_provider_id,
series_provider.show_url,
int(series['id']),
series['seriesname'],
series['firstaired'],
('', 'disabled')[isinstance(find_show(int(series['id']), SeriesProviderID[series_provider_id]), TVShow)]
))
search_results = series_provider.search(search_term, language=series_provider_language)
if search_results:
for series in series_provider.search(search_term, language=series_provider_language):
if not series.get('seriesname', None):
continue
if not series.get('firstaired', None):
continue
search_results.append((
series_provider.name,
series_provider_id,
series_provider.show_url,
int(series['id']),
series['seriesname'],
series['firstaired'],
('', 'disabled')[isinstance(find_show(int(series['id']), SeriesProviderID[series_provider_id]), TVShow)]
))
return self.write(json_encode({'results': search_results, 'langid': lang}))
......
......@@ -121,6 +121,7 @@ class SeriesProviderShow(dict):
Search terms are converted to lower case (unicode) strings.
"""
results = []
for cur_season in self.values():
searchresult = cur_season.search(term=term, key=key)
if len(searchresult) != 0:
......
......@@ -133,7 +133,7 @@ class SubsceneProvider(Provider):
cells = row('td')
language = Language.fromsubscene(cells[0].find_all('span')[0].get_text(strip=True))
hearing_impaired = (False, True)[cells[2].attrs.values()[0] == 41]
hearing_impaired = (False, True)[list(cells[2].attrs.values())[0] == 41]
page_link = cells[0].find('a')['href']
release = cells[0].find_all('span')[1].get_text(strip=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment