Private GIT

Skip to content
Snippets Groups Projects
Commit f452106b authored by clinton-hall's avatar clinton-hall Committed by Ruud
Browse files

Added comparison of sets of required words

Can now match sets of words containing words separated by & with each set separated by ,
This only requires any set of word(s) to be matched, but within each set ALL words must match.
parent da3055be
No related branches found
No related tags found
No related merge requests found
...@@ -307,7 +307,13 @@ class Searcher(Plugin): ...@@ -307,7 +307,13 @@ class Searcher(Plugin):
nzb_words = re.split('\W+', nzb_name) nzb_words = re.split('\W+', nzb_name)
required_words = [x.strip().lower() for x in self.conf('required_words').lower().split(',')] required_words = [x.strip().lower() for x in self.conf('required_words').lower().split(',')]
if self.conf('required_words') and not list(set(nzb_words) & set(required_words)): req_match = 0
for index in range(len(required_words)):
req = [x.strip().lower() for x in required_words[index].lower().split('&')]
if len(list(set(nzb_words) & set(req))) == len(req):
req_match = req_match + 1
if self.conf('required_words') and req_match == 0:
log.info2("Wrong: Required word missing: %s" % nzb['name']) log.info2("Wrong: Required word missing: %s" % nzb['name'])
return False return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment