mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-08 02:53:38 +00:00
Merge pull request #32 from adam111316/feature/FixNonEscapedWords
Fix searches freezing due to unescaped ignored or required words
This commit is contained in:
commit
79d359607c
2 changed files with 5 additions and 4 deletions
|
@ -44,6 +44,7 @@
|
||||||
* Fix failing "Providers" link on Config/Search Settings/Episode Search
|
* Fix failing "Providers" link on Config/Search Settings/Episode Search
|
||||||
* Change case of labels in General Config/Interface/Timezone
|
* 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
|
* 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]
|
[develop changelog]
|
||||||
* Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217
|
* 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 any of the bad strings are in the name then say no
|
||||||
if sickbeard.IGNORE_WORDS:
|
if sickbeard.IGNORE_WORDS:
|
||||||
resultFilters.extend(sickbeard.IGNORE_WORDS.split(','))
|
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:
|
for regfilter in filters:
|
||||||
if regfilter.search(name):
|
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)
|
logger.DEBUG)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# if any of the good strings aren't in the name then say no
|
# if any of the good strings aren't in the name then say no
|
||||||
if sickbeard.REQUIRE_WORDS:
|
if sickbeard.REQUIRE_WORDS:
|
||||||
require_words = sickbeard.REQUIRE_WORDS.split(',')
|
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:
|
for regfilter in filters:
|
||||||
if not regfilter.search(name):
|
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)
|
logger.DEBUG)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue