mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Merge pull request #522 from JackDandy/feature/ChangeRemoveNonReleaseGroups
Change increase the scope and number of non release group text that …
This commit is contained in:
commit
fb484efba0
5 changed files with 18 additions and 11 deletions
|
@ -52,6 +52,7 @@
|
||||||
* Change increase frequency of updating show data
|
* Change increase frequency of updating show data
|
||||||
* Remove FreshOnTV (TvT) torrent provider
|
* Remove FreshOnTV (TvT) torrent provider
|
||||||
* Remove Strike torrent provider
|
* Remove Strike torrent provider
|
||||||
|
* Change increase the scope and number of non release group text that is identified and removed
|
||||||
|
|
||||||
[develop changelog]
|
[develop changelog]
|
||||||
Enable Alpha Ratio again now that the secure login page over https is fixed
|
Enable Alpha Ratio again now that the secure login page over https is fixed
|
||||||
|
|
|
@ -99,10 +99,18 @@ def remove_non_release_groups(name):
|
||||||
Remove non release groups from name
|
Remove non release groups from name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if name and "-" in name:
|
if name:
|
||||||
name_group = name.rsplit('-', 1)
|
rc = [re.compile(r'(?i)' + v) for v in
|
||||||
if name_group[-1].upper() in ["RP", "NZBGEEK"]:
|
'([\s\.\-_\[\{\(]*(no-rar|nzbgeek|ripsalot|rp|siklopentan)[\s\.\-_\]\}\)]*)$',
|
||||||
name = name_group[0]
|
'(?<=\w)([\s\.\-_]*[\[\{\(][\s\.\-_]*(www\.\w+.\w+)[\s\.\-_]*[\]\}\)][\s\.\-_]*)$',
|
||||||
|
'(?<=\w)([\s\.\-_]*[\[\{\(]\s*(rar(bg|tv)|((e[tz]|v)tv))[\s\.\-_]*[\]\}\)][\s\.\-_]*)$',
|
||||||
|
'(?<=\w)([\s\.\-_]*[\[\{\(][\s\.\-_]*[\w\s\.\-\_]+[\s\.\-_]*[\]\}\)][\s\.\-_]*)$'
|
||||||
|
]
|
||||||
|
rename = name
|
||||||
|
while rename:
|
||||||
|
for regex in rc:
|
||||||
|
name = regex.sub('', name)
|
||||||
|
rename = (name, False)[name == rename]
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ class NameParser(object):
|
||||||
result.score += 1
|
result.score += 1
|
||||||
|
|
||||||
if 'release_group' in named_groups:
|
if 'release_group' in named_groups:
|
||||||
result.release_group = match.group('release_group')
|
result.release_group = helpers.remove_non_release_groups(match.group('release_group'))
|
||||||
result.score += 1
|
result.score += 1
|
||||||
|
|
||||||
if 'version' in named_groups:
|
if 'version' in named_groups:
|
||||||
|
|
|
@ -467,12 +467,10 @@ class PostProcessor(object):
|
||||||
if not name:
|
if not name:
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
name = helpers.remove_non_release_groups(helpers.remove_extension(name))
|
|
||||||
|
|
||||||
# parse the name to break it into show name, season, and episode
|
# parse the name to break it into show name, season, and episode
|
||||||
np = NameParser(resource, try_scene_exceptions=True, convert=True)
|
np = NameParser(resource, try_scene_exceptions=True, convert=True)
|
||||||
parse_result = np.parse(name)
|
parse_result = np.parse(name)
|
||||||
self._log(u'Parsed %s<br />.. into %s' % (name, str(parse_result).decode('utf-8', 'xmlcharrefreplace')), logger.DEBUG)
|
self._log(u'Parsed %s<br />.. from %s' % (str(parse_result).decode('utf-8', 'xmlcharrefreplace'), name), logger.DEBUG)
|
||||||
|
|
||||||
if parse_result.is_air_by_date:
|
if parse_result.is_air_by_date:
|
||||||
season = -1
|
season = -1
|
||||||
|
|
|
@ -207,13 +207,13 @@ class TVCache:
|
||||||
showObj = helpers.findCertainShow(sickbeard.showList, indexer_id)
|
showObj = helpers.findCertainShow(sickbeard.showList, indexer_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
myParser = NameParser(showObj=showObj, convert=True)
|
np = NameParser(showObj=showObj, convert=True)
|
||||||
parse_result = myParser.parse(name)
|
parse_result = np.parse(name)
|
||||||
except InvalidNameException:
|
except InvalidNameException:
|
||||||
logger.log(u'Unable to parse the filename ' + name + ' into a valid episode', logger.DEBUG)
|
logger.log(u'Unable to parse the filename ' + name + ' into a valid episode', logger.DEBUG)
|
||||||
return None
|
return None
|
||||||
except InvalidShowException:
|
except InvalidShowException:
|
||||||
logger.log(u'Unable to parse the filename ' + name + ' into a valid show', logger.DEBUG)
|
logger.log(u'No show in the db matches filename ' + name + ' not cached', logger.DEBUG)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if not parse_result or not parse_result.series_name:
|
if not parse_result or not parse_result.series_name:
|
||||||
|
|
Loading…
Reference in a new issue