diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 60885286..668f62c7 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -1800,7 +1800,7 @@ def save_config(): def launch_browser(start_port=None): if not start_port: start_port = WEB_PORT - browser_url = 'http%s://localhost:%d%s' % (('s' or '')[not ENABLE_HTTPS], start_port, WEB_ROOT) + browser_url = 'http%s://localhost:%d%s' % (('s', '')[not ENABLE_HTTPS], start_port, WEB_ROOT) try: webbrowser.open(browser_url, 2, 1) except (StandardError, Exception): diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index 1a560e60..4cb39b5a 100755 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -444,13 +444,18 @@ class NewznabProvider(generic.NZBProvider): Quality.HDBLURAY, Quality.FULLHDBLURAY] max_hd = Quality.FULLHDBLURAY for s in searches: + if need_sd and need_hd and need_uhd: + break if not s.show.is_anime and not s.show.is_sports: - if not need_sd and min(s.wantedQuality) <= max_sd: - need_sd = True - if not need_hd and any(i in hd_qualities for i in s.wantedQuality): - need_hd = True - if not need_uhd and max(s.wantedQuality) > max_hd: - need_uhd = True + if Quality.UNKNOWN in s.wantedQuality: + need_sd = need_hd = need_uhd = True + else: + if not need_sd and min(s.wantedQuality) <= max_sd: + need_sd = True + if not need_hd and any(i in hd_qualities for i in s.wantedQuality): + need_hd = True + if not need_uhd and max(s.wantedQuality) > max_hd: + need_uhd = True per_ep, limit_per_ep = 0, 0 if need_sd and not need_hd: per_ep, limit_per_ep = 10, 25 @@ -474,12 +479,15 @@ class NewznabProvider(generic.NZBProvider): if not season_search: need_sd = need_hd = need_uhd = False if not ep_obj.show.is_anime and not ep_obj.show.is_sports: - if min(ep_obj.wantedQuality) <= max_sd: - need_sd = True - if any(i in hd_qualities for i in ep_obj.wantedQuality): - need_hd = True - if max(ep_obj.wantedQuality) > max_hd: - need_uhd = True + if Quality.UNKNOWN in ep_obj.wantedQuality: + need_sd = need_hd = need_uhd = True + else: + if min(ep_obj.wantedQuality) <= max_sd: + need_sd = True + if any(i in hd_qualities for i in ep_obj.wantedQuality): + need_hd = True + if max(ep_obj.wantedQuality) > max_hd: + need_uhd = True return (season_search, need_sd, need_hd, need_uhd, (hits_per_page * 100 // hits_per_page * 2, hits_per_page * int(ceil(rel_limit * 1.5)))[season_search]) diff --git a/sickbeard/search.py b/sickbeard/search.py index e7ebf7fe..1dbbd566 100644 --- a/sickbeard/search.py +++ b/sickbeard/search.py @@ -387,7 +387,7 @@ def wanted_episodes(show, from_date, make_dict=False, unaired=False): ep_obj = show.getEpisode(int(result['season']), int(result['episode'])) ep_obj.wantedQuality = [i for i in (wanted_qualities, initial_qualities)[not_downloaded] - if (common.Quality.UNKNOWN != i and cur_quality < i)] + if cur_quality < i] ep_obj.eps_aired_in_season = ep_count.get(helpers.tryInt(result['season']), 0) ep_obj.eps_aired_in_scene_season = ep_count_scene.get( helpers.tryInt(result['scene_season']), 0) if result['scene_season'] else ep_obj.eps_aired_in_season diff --git a/sickbeard/search_queue.py b/sickbeard/search_queue.py index 227ae198..7f389ce0 100644 --- a/sickbeard/search_queue.py +++ b/sickbeard/search_queue.py @@ -206,15 +206,20 @@ class RecentSearchQueueItem(generic_queue.QueueItem): need_anime = True if not need_sports and curShow.is_sports: need_sports = True - if not need_sd or not need_hd: + if not need_sd or not need_hd or not need_uhd: for w in wanted_eps: + if need_sd and need_hd and need_uhd: + break if not w.show.is_anime and not w.show.is_sports: - if not need_sd and max_sd >= min(w.wantedQuality): - need_sd = True - if not need_hd and any(i in hd_qualities for i in w.wantedQuality): - need_hd = True - if not need_uhd and max_hd < max(w.wantedQuality): - need_uhd = True + if Quality.UNKNOWN in w.wantedQuality: + need_sd = need_hd = need_uhd = True + else: + if not need_sd and max_sd >= min(w.wantedQuality): + need_sd = True + if not need_hd and any(i in hd_qualities for i in w.wantedQuality): + need_hd = True + if not need_uhd and max_hd < max(w.wantedQuality): + need_uhd = True self.episodes.extend(wanted_eps) self.update_providers(need_anime=need_anime, need_sports=need_sports,