From ce022a64f6fa9b6d4e90442547566b64f99e2359 Mon Sep 17 00:00:00 2001 From: Malte Ried Date: Sat, 12 Sep 2015 20:44:56 +0200 Subject: [PATCH] Files should be matched exactly so the search for a.mp3 doesn't find a.mp3.foo. --- beets/library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/library.py b/beets/library.py index 945806b8b..10cddc69d 100644 --- a/beets/library.py +++ b/beets/library.py @@ -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)