Files should be matched exactly so the search for a.mp3 doesn't find a.mp3.foo.

This commit is contained in:
Malte Ried 2015-09-12 20:44:56 +02:00
parent 0e0941c778
commit ce022a64f6

View file

@ -102,7 +102,7 @@ class PathQuery(dbcore.FieldQuery):
dir_pattern = self.escape_re.sub(escape, self.dir_path)
dir_blob = buffer(dir_pattern + b'%')
file_pattern = self.escape_re.sub(escape, self.file_path)
file_blob = buffer(file_pattern + b'%')
file_blob = buffer(file_pattern)
return '({0} LIKE ? ESCAPE ?) || ({0} LIKE ? ESCAPE ?)'.format(
self.field), (file_blob, self.escape_char, dir_blob,
self.escape_char)