mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03: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,13 +242,11 @@ def filter_release_name(name, filter_words):
|
||||||
Returns: False if the release name is OK, True if it contains one of the filter_words
|
Returns: False if the release name is OK, True if it contains one of the filter_words
|
||||||
"""
|
"""
|
||||||
if filter_words:
|
if filter_words:
|
||||||
for test_word in filter_words.split(','):
|
filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in filter_words.split(',')]
|
||||||
test_word = test_word.strip()
|
for regfilter in filters:
|
||||||
|
if regfilter.search(name):
|
||||||
if test_word:
|
logger.log(u"" + name + " contains pattern: " + regfilter.pattern, logger.DEBUG)
|
||||||
if re.search('(^|[\W_]|[\s_])' + test_word + '($|[\W_]|[\s_])', name, re.I):
|
return True
|
||||||
logger.log(u"" + name + " contains word: " + test_word, logger.DEBUG)
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,10 @@ def filterBadReleases(name):
|
||||||
# if any of the bad strings are in the name then say no
|
# if any of the bad strings are in the name then say no
|
||||||
if sickbeard.IGNORE_WORDS:
|
if sickbeard.IGNORE_WORDS:
|
||||||
resultFilters + sickbeard.IGNORE_WORDS.split(',')
|
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:
|
for regfilter in filters:
|
||||||
if regfilter.search(name):
|
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 False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue