mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 05:33:37 +00:00
Fix for reguired and prefered ignore words.
This commit is contained in:
parent
3d43c6b5bf
commit
07cee09c83
2 changed files with 7 additions and 9 deletions
|
@ -242,12 +242,10 @@ def filter_release_name(name, filter_words):
|
|||
Returns: False if the release name is OK, True if it contains one of the filter_words
|
||||
"""
|
||||
if filter_words:
|
||||
for test_word in filter_words.split(','):
|
||||
test_word = test_word.strip()
|
||||
|
||||
if test_word:
|
||||
if re.search('(^|[\W_]|[\s_])' + test_word + '($|[\W_]|[\s_])', name, re.I):
|
||||
logger.log(u"" + name + " contains word: " + test_word, logger.DEBUG)
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in filter_words.split(',')]
|
||||
for regfilter in filters:
|
||||
if regfilter.search(name):
|
||||
logger.log(u"" + name + " contains pattern: " + regfilter.pattern, logger.DEBUG)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
|
@ -69,10 +69,10 @@ def filterBadReleases(name):
|
|||
# if any of the bad strings are in the name then say no
|
||||
if sickbeard.IGNORE_WORDS:
|
||||
resultFilters + sickbeard.IGNORE_WORDS.split(',')
|
||||
filters = [re.compile('(^|[\W_]|[\s_])%s($|[\W_]|[\s_])' % filter.strip(), re.I) for filter in resultFilters]
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in resultFilters]
|
||||
for regfilter in filters:
|
||||
if regfilter.search(name):
|
||||
logger.log(u"Invalid scene release: " + name + " contains " + regfilter.pattern + ", ignoring it", logger.DEBUG)
|
||||
logger.log(u"Invalid scene release: " + name + " contains pattern: " + regfilter.pattern + ", ignoring it", logger.DEBUG)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue