1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Fixed "show must be added to list", regexes now check if numbers following after the series name is a date or part of the series name to properly parse and return correct show object.

Fixes TVDB and TVRAGE cache_location variable.
This commit is contained in:
echel0n 2014-06-29 23:20:19 -07:00
parent 46b80c115e
commit 2c98a5a448
3 changed files with 10 additions and 6 deletions

View File

@ -466,12 +466,14 @@ class Tvdb:
if cache is True:
self.config['cache_enabled'] = True
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self._getTempDir()))
self.config['cache_location'] = self._getTempDir()
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self.config['cache_location']))
elif cache is False:
self.config['cache_enabled'] = False
elif isinstance(cache, basestring):
self.config['cache_enabled'] = True
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(cache))
self.config['cache_location'] = cache
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self.config['cache_location']))
else:
raise ValueError("Invalid value for Cache %r (type was %s)" % (cache, type(cache)))

View File

@ -318,12 +318,14 @@ class TVRage:
if cache is True:
self.config['cache_enabled'] = True
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self._getTempDir()))
self.config['cache_location'] = self._getTempDir()
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self.config['cache_location']))
elif cache is False:
self.config['cache_enabled'] = False
elif isinstance(cache, basestring):
self.config['cache_enabled'] = True
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(cache))
self.config['cache_location'] = cache
self.sess = cachecontrol.CacheControl(cache=caches.FileCache(self.config['cache_location']))
else:
raise ValueError("Invalid value for Cache %r (type was %s)" % (cache, type(cache)))

View File

@ -124,8 +124,8 @@ class NameParser(object):
if not self.showObj and not self.naming_pattern:
# Regex pattern to return the Show / Series Name regardless of the file pattern tossed at it, matched 53 show name examples from regexes.py
show_pattern = '''(?:(?:\[.*?\])|(?:\d{3}[\.-]))*[ _\.]?(?P<series_name>.*?(?:[ ._-](\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))'''
show_pattern_alt = '''^(?P<series_name>.*?(?:[ ._-](\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))'''
show_pattern = '''(?:(?:\[.*?\])|(?:\d{3}[\.-]))*[ _\.]?(?P<series_name>.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))'''
show_pattern_alt = '''^(?P<series_name>.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))'''
self.showObj = self._matchShowName(name, show_pattern)
if not self.showObj: