diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ebe134e64..f0d08ec65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ #### Improvements #### Fixes +- Fixed season pack downloads occurring even if not needed ([#7472](https://github.com/pymedusa/Medusa/pull/7472)) ----- @@ -16,7 +17,6 @@ - Improve a number of anime release names parsed by guessit ([#7418](https://github.com/pymedusa/Medusa/pull/7418)) ([#7396](https://github.com/pymedusa/Medusa/pull/7396)) ([#7427](https://github.com/pymedusa/Medusa/pull/7427)) #### Fixes - - Show Header: Fix showing correct amount of stars for the IMDB rating ([#7401](https://github.com/pymedusa/Medusa/pull/7401)) - Re-implement tvdb season poster/banners (was disabled because of tvdb api issues) ([#7460](https://github.com/pymedusa/Medusa/pull/7460)) - Fix showing the data directory in the bottom of some config pages ([#7424](https://github.com/pymedusa/Medusa/pull/7424)) diff --git a/medusa/classes.py b/medusa/classes.py index 13ea5276fd..bd2b865902 100644 --- a/medusa/classes.py +++ b/medusa/classes.py @@ -220,8 +220,14 @@ def _create_episode_objects(self): if self.actual_season is not None and self.series: if self.actual_episodes: self.episodes = [self.series.get_episode(self.actual_season, ep) for ep in self.actual_episodes] + if len(self.actual_episodes) == 1: + self.episode_number = self.actual_episodes[0] + else: + self.episode_number = MULTI_EP_RESULT else: self.episodes = self.series.get_all_episodes(self.actual_season) + self.actual_episodes = [ep.episode for ep in self.episodes] + self.episode_number = SEASON_RESULT return self.episodes @@ -245,12 +251,6 @@ def _episodes_from_cache(self): # Season result if not sql_episodes: ep_objs = series_obj.get_all_episodes(actual_season) - if not ep_objs: - # We couldn't get any episodes for this season, which is odd, skip the result. - log.debug("We couldn't get any episodes for season {0} of {1}, skipping", - actual_season, cached_data['name']) - return - self.actual_episodes = [ep.episode for ep in ep_objs] self.episode_number = SEASON_RESULT diff --git a/medusa/providers/generic_provider.py b/medusa/providers/generic_provider.py index a37435d720..00e1bd184e 100644 --- a/medusa/providers/generic_provider.py +++ b/medusa/providers/generic_provider.py @@ -424,23 +424,20 @@ def find_search_results(self, series, episodes, search_mode, forced_search=False search_result.update_search_result() - if not search_result.actual_episodes: - episode_number = SEASON_RESULT + if search_result.episode_number == SEASON_RESULT: log.debug('Found season pack result {0} at {1}', search_result.name, search_result.url) - elif len(search_result.actual_episodes) == 1: - episode_number = search_result.actual_episode - log.debug('Found single episode result {0} at {1}', search_result.name, search_result.url) - else: - episode_number = MULTI_EP_RESULT + elif search_result.episode_number == MULTI_EP_RESULT: log.debug('Found multi-episode ({0}) result {1} at {2}', ', '.join(map(str, search_result.parsed_result.episode_numbers)), search_result.name, search_result.url) + else: + log.debug('Found single episode result {0} at {1}', search_result.name, search_result.url) - if episode_number not in final_results: - final_results[episode_number] = [search_result] + if search_result.episode_number not in final_results: + final_results[search_result.episode_number] = [search_result] else: - final_results[episode_number].append(search_result) + final_results[search_result.episode_number].append(search_result) if cl: # Access to a protected member of a client class diff --git a/medusa/tv/cache.py b/medusa/tv/cache.py index d59b923a1a..67eb545e06 100644 --- a/medusa/tv/cache.py +++ b/medusa/tv/cache.py @@ -609,11 +609,10 @@ def find_episodes(self, episodes): continue search_result = self.provider.get_result(series=series_obj, cache=cur_result) - if search_result.episode_number is not None: - if search_result in cache_results[search_result.episode_number]: - continue - # add it to the list - cache_results[search_result.episode_number].append(search_result) + if search_result in cache_results[search_result.episode_number]: + continue + # add it to the list + cache_results[search_result.episode_number].append(search_result) # datetime stamp this search so cache gets cleared self.searched = time()