Update to exact match search for exclude_tags

This commit is contained in:
GRiker 2010-02-12 11:26:38 -07:00
parent 54c7a378c4
commit fd82ec6002

View File

@ -901,14 +901,14 @@ class EPUB_MOBI(CatalogPlugin):
self.opts.sort_by = 'title' self.opts.sort_by = 'title'
# Merge opts.exclude_tags with opts.search_text # Merge opts.exclude_tags with opts.search_text
# Updated to use exact match syntax
empty_exclude_tags = False if len(self.opts.exclude_tags) else True empty_exclude_tags = False if len(self.opts.exclude_tags) else True
search_phrase = '' search_phrase = ''
if not empty_exclude_tags: if not empty_exclude_tags:
exclude_tags = self.opts.exclude_tags.split(',') exclude_tags = self.opts.exclude_tags.split(',')
search_terms = [] search_terms = []
for tag in exclude_tags: for tag in exclude_tags:
search_terms.append("tag:%s" % tag) search_terms.append("tag:=%s" % tag)
#search_terms.append("tag:=%s" % tag)
search_phrase = "not (%s)" % " or ".join(search_terms) search_phrase = "not (%s)" % " or ".join(search_terms)
# If a list of ids are provided, don't use search_text # If a list of ids are provided, don't use search_text