mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Fix searches freezing due to unescaped ignored or required words
Conflicts: CHANGES.md
This commit is contained in:
parent
f65227bf43
commit
bb2d874d2b
2 changed files with 5 additions and 4 deletions
|
@ -44,6 +44,7 @@
|
|||
* Fix failing "Providers" link on Config/Search Settings/Episode Search
|
||||
* Change case of labels in General Config/Interface/Timezone
|
||||
* Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab
|
||||
* Fix searches freezing due to unescaped ignored or required words
|
||||
|
||||
[develop changelog]
|
||||
* Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217
|
||||
|
|
|
@ -59,20 +59,20 @@ def filterBadReleases(name, parse=True):
|
|||
# if any of the bad strings are in the name then say no
|
||||
if sickbeard.IGNORE_WORDS:
|
||||
resultFilters.extend(sickbeard.IGNORE_WORDS.split(','))
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in resultFilters]
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in resultFilters]
|
||||
for regfilter in filters:
|
||||
if regfilter.search(name):
|
||||
logger.log(u"Invalid scene release: " + name + " contains pattern: " + regfilter.pattern + ", ignoring it",
|
||||
logger.log(u"Invalid scene release: " + name + " contained: " + regfilter.pattern + ", ignoring it",
|
||||
logger.DEBUG)
|
||||
return False
|
||||
|
||||
# if any of the good strings aren't in the name then say no
|
||||
if sickbeard.REQUIRE_WORDS:
|
||||
require_words = sickbeard.REQUIRE_WORDS.split(',')
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in require_words]
|
||||
filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in require_words]
|
||||
for regfilter in filters:
|
||||
if not regfilter.search(name):
|
||||
logger.log(u"Invalid scene release: " + name + " doesn't contain pattern: " + regfilter.pattern + ", ignoring it",
|
||||
logger.log(u"Invalid scene release: " + name + " didn't contain: " + regfilter.pattern + ", ignoring it",
|
||||
logger.DEBUG)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue