diff --git a/CHANGES.md b/CHANGES.md index 50c1fd04..3e5a73ab 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ * Change remove AlphaRatio until their secure login page over https is fixed * Add Torrenting provider * Add FunFile torrent provider +* Remove unnecessary call to indexers during nameparsing ### 0.10.0 (2015-08-06 11:05:00 UTC) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 09942c0b..dc0fe958 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -854,7 +854,7 @@ def full_sanitizeSceneName(name): return re.sub('[. -]', ' ', sanitizeSceneName(name)).lower().lstrip() -def get_show(name, try_indexers=False, try_scene_exceptions=False): +def get_show(name, try_scene_exceptions=False): if not sickbeard.showList or None is name: return @@ -872,10 +872,6 @@ def get_show(name, try_indexers=False, try_scene_exceptions=False): if indexer_id: show_obj = findCertainShow(sickbeard.showList, indexer_id) - if not show_obj and try_indexers: - show_obj = findCertainShow(sickbeard.showList, - searchIndexerForShowID(full_sanitizeSceneName(name), ui=classes.ShowListUI)[2]) - # add show to cache if show_obj and not from_cache: sickbeard.name_cache.addNameToCache(name, show_obj.indexerid) diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index c9c702c2..b8ba97ce 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -36,12 +36,11 @@ class NameParser(object): NORMAL_REGEX = 1 ANIME_REGEX = 2 - def __init__(self, file_name=True, showObj=None, try_indexers=False, try_scene_exceptions=False, convert=False, + def __init__(self, file_name=True, showObj=None, try_scene_exceptions=False, convert=False, naming_pattern=False, testing=False): self.file_name = file_name self.showObj = showObj - self.try_indexers = try_indexers self.try_scene_exceptions = try_scene_exceptions self.convert = convert self.naming_pattern = naming_pattern @@ -203,7 +202,7 @@ class NameParser(object): show = None if not self.naming_pattern: # try and create a show object for this result - show = helpers.get_show(best_result.series_name, self.try_indexers, self.try_scene_exceptions) + show = helpers.get_show(best_result.series_name, self.try_scene_exceptions) # confirm passed in show object indexer id matches result show object indexer id if show and not self.testing: diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 6ed1a27e..37f4e9a5 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -470,7 +470,7 @@ class PostProcessor(object): name = helpers.remove_non_release_groups(helpers.remove_extension(name)) # parse the name to break it into show name, season, and episode - np = NameParser(resource, try_indexers=True, try_scene_exceptions=True, convert=True) + np = NameParser(resource, try_scene_exceptions=True, convert=True) parse_result = np.parse(name) self._log(u'Parsed %s
.. into %s' % (name, str(parse_result).decode('utf-8', 'xmlcharrefreplace')), logger.DEBUG) diff --git a/sickbeard/processTV.py b/sickbeard/processTV.py index 78fa50d2..e6601ca8 100644 --- a/sickbeard/processTV.py +++ b/sickbeard/processTV.py @@ -421,19 +421,13 @@ class ProcessTVShow(object): parse_result = None try: - parse_result = NameParser(try_indexers=True, - try_scene_exceptions=True, - convert=True).parse(videofile, - cache_result=False) + parse_result = NameParser(try_scene_exceptions=True, convert=True).parse(videofile, cache_result=False) except (InvalidNameException, InvalidShowException): # Does not parse, move on to directory check pass if None is parse_result: try: - parse_result = NameParser(try_indexers=True, - try_scene_exceptions=True, - convert=True).parse( - dir_name, cache_result=False) + parse_result = NameParser(try_scene_exceptions=True,convert=True).parse(dir_name, cache_result=False) except (InvalidNameException, InvalidShowException): # If the filename doesn't parse, then return false as last # resort. We can assume that unparseable filenames are not diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 47d3c702..6d0e2a52 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -427,7 +427,7 @@ class TVShow(object): try: parse_result = None - np = NameParser(False, showObj=self, try_indexers=True) + np = NameParser(False, showObj=self) parse_result = np.parse(ep_file_name) except (InvalidNameException, InvalidShowException): pass @@ -619,7 +619,7 @@ class TVShow(object): logger.log(u'%s: Creating episode object from %s' % (self.indexerid, file), logger.DEBUG) try: - my_parser = NameParser(showObj=self, try_indexers=True) + my_parser = NameParser(showObj=self) parse_result = my_parser.parse(file) except InvalidNameException: logger.log(u'Unable to parse the filename %s into a valid episode' % file, logger.DEBUG)