diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 51d71594..ab38eb54 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -942,7 +942,7 @@ def _check_against_names(name, show): return False -def get_show_by_name(name, checkExceptions=False, checkIndexers=False): +def get_show_by_name(name, checkIndexers=False): in_cache = False foundResult = None @@ -973,18 +973,17 @@ def get_show_by_name(name, checkExceptions=False, checkIndexers=False): u"Database lookup found Indexer ID:" + str( foundResult.indexerid) + ", using that for " + name, logger.DEBUG) - if not foundResult and checkExceptions: - if not foundResult: - logger.log( - u"Checking the scene exceptions list for:" + str(name), - logger.DEBUG) + if not foundResult: + logger.log( + u"Checking the scene exceptions list for:" + str(name), + logger.DEBUG) - for show in sickbeard.showList: - if _check_against_names(name, show): - logger.log( - u"Scene exceptions lookup found Indexer ID:" + str(show.indexerid) + ", using that for " + name, - logger.DEBUG) - foundResult = show + for show in sickbeard.showList: + if _check_against_names(name, show): + logger.log( + u"Scene exceptions lookup found Indexer ID:" + str(show.indexerid) + ", using that for " + name, + logger.DEBUG) + foundResult = show if not foundResult and checkIndexers: logger.log( @@ -1003,7 +1002,7 @@ def get_show_by_name(name, checkExceptions=False, checkIndexers=False): continue if showObj: - foundResult = findCertainShow(sickbeard.showList, int(showObj["id"])) + foundResult = findCertainShow(sickbeard.showList, int(showObj[0]['id'])) if foundResult: logger.log( u"Indexers lookup found Indexer ID:" + str( diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index 4a907eeb..77db531c 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -239,7 +239,6 @@ class NameParser(object): final_result.air_date = self._combine_results(file_name_result, dir_name_result, 'air_date') # sports event title - final_result.sports_event_title = self._combine_results(file_name_result, dir_name_result, 'sports_event_title') final_result.sports_event_date = self._combine_results(file_name_result, dir_name_result, 'sports_event_date') if not final_result.air_date: @@ -248,6 +247,9 @@ class NameParser(object): # if the dirname has a release group/show name I believe it over the filename final_result.series_name = self._combine_results(dir_name_result, file_name_result, 'series_name') + if final_result.sports: + final_result.series_name = str(final_result.series_name).partition(" ")[0] + final_result.extra_info = self._combine_results(dir_name_result, file_name_result, 'extra_info') final_result.release_group = self._combine_results(dir_name_result, file_name_result, 'release_group') @@ -320,8 +322,6 @@ class ParseResult(object): return False if self.air_date != other.air_date: return False - if self.sports_event_title != other.sports_event_title: - return False if self.sports_event_date != other.sports_event_date: return False @@ -341,7 +341,6 @@ class ParseResult(object): if self.air_by_date: to_return += str(self.air_date) if self.sports: - to_return += str(self.sports_event_title) to_return += str(self.sports_event_date) if self.extra_info: @@ -410,14 +409,14 @@ class NameParserCache(object): _previous_parsed = {} _cache_size = 100 - def add(self, name, parse_result, convert=False): + def add(self, name, parse_result): self._previous_parsed[name] = parse_result self._previous_parsed_list.append(name) while len(self._previous_parsed_list) > self._cache_size: del_me = self._previous_parsed_list.pop(0) self._previous_parsed.pop(del_me) - def get(self, name, convert=False): + def get(self, name): if name in self._previous_parsed: logger.log("Using cached parse result for: " + name, logger.DEBUG) return self._previous_parsed[name] diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index fb97336b..1d358bd4 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -464,6 +464,9 @@ class PostProcessor(object): if parse_result.air_by_date: season = -1 episodes = [parse_result.air_date] + elif parse_result.sports: + season = -1 + episodes = [parse_result.sports_event_date] else: season = parse_result.season_number episodes = parse_result.episode_numbers @@ -506,7 +509,7 @@ class PostProcessor(object): # for each possible interpretation of that scene name for cur_name in name_list: - showObj = helpers.get_show_by_name(cur_name) + showObj = helpers.get_show_by_name(cur_name, checkIndexers=True) if showObj: _finalize(parse_result) return (showObj.indexerid, season, episodes) @@ -624,7 +627,7 @@ class PostProcessor(object): season = 1 if indexer_id and season and episodes: - return (indexer_id, season, episodes) + break return (indexer_id, season, episodes) @@ -817,7 +820,7 @@ class PostProcessor(object): # try to find the file info (indexer_id, season, episodes) = self._find_info() if not (indexer_id and season and len(episodes)): - self._log(u"Can't find the show on any of the Indexers, skipping", + self._log(u"Unable to find enough info to post-process this show, skipping", logger.WARNING) return False