Change search only once per cycle for shows with multiple episodes that air on the same day.

This commit is contained in:
JackDandy 2018-05-14 01:16:50 +01:00
parent 6d0bcddd03
commit e35375f5ef
3 changed files with 21 additions and 4 deletions

View file

@ -2,6 +2,7 @@
* Change improve tolerance to parse a release title with a badly placed episode name
* Change improve handling tvdb_api data when adding upcoming shows with unfilled data
* Change search only once per cycle for shows with multiple episodes that air on the same day
### 0.16.5 (2018-05-07 21:15:00 UTC)

View file

@ -884,9 +884,8 @@ class GenericProvider(object):
return results
searched_scene_season = None
search_list = []
for ep_obj in episodes:
if self.should_skip(log_warning=False):
break
# search cache for episode result
cache_result = self.cache.searchCache(ep_obj, manual_search)
if cache_result:
@ -911,7 +910,16 @@ class GenericProvider(object):
# get single episode search params
search_params = self._episode_strings(ep_obj)
search_list += [search_params]
search_done = []
for search_params in search_list:
if self.should_skip(log_warning=False):
break
for cur_param in search_params:
if cur_param in search_done:
continue
search_done += [cur_param]
item_list += self._search_provider(cur_param, search_mode=search_mode, epcount=len(episodes))
if self.should_skip():
break

View file

@ -563,9 +563,8 @@ class NewznabProvider(generic.NZBProvider):
name_space = {}
searched_scene_season = s_mode = None
search_list = []
for ep_obj in episodes:
if self.should_skip(log_warning=False):
break
# skip if season already searched
if (s_mode or 'sponly' == search_mode) and 1 < len(episodes) \
and searched_scene_season == ep_obj.scene_season:
@ -598,7 +597,16 @@ class NewznabProvider(generic.NZBProvider):
else:
search_params = self._episode_strings(ep_obj)
search_list += [(search_params, needed, max_items)]
search_done = []
for (search_params, needed, max_items) in search_list:
if self.should_skip(log_warning=False):
break
for cur_param in search_params:
if cur_param in search_done:
continue
search_done += [cur_param]
items, n_space = self._search_provider(cur_param, search_mode=search_mode, epcount=len(episodes),
needed=needed, max_items=max_items,
try_all_searches=try_other_searches)