mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 16:23:04 +01:00
PathQuery: use substr() instead of instr()
substr() is only available in SQLite 3.7.15+, which is not available yet on Debian stable, CentOS & co. Use substr() instead.
This commit is contained in:
parent
83e34322e9
commit
6fc678e947
1 changed files with 2 additions and 2 deletions
|
|
@ -73,8 +73,8 @@ class PathQuery(dbcore.FieldQuery):
|
|||
|
||||
if not self._is_windows:
|
||||
dir_blob = buffer(self.dir_path)
|
||||
return '({0} = ?) || (instr({0}, ?) = 1)'.format(self.field), \
|
||||
(file_blob, dir_blob)
|
||||
return '({0} = ?) || (substr({0}, 1, ?) = ?)'.format(self.field), \
|
||||
(file_blob, len(dir_blob), dir_blob)
|
||||
|
||||
escape = lambda m: self.escape_char + m.group(0)
|
||||
dir_pattern = self.escape_re.sub(escape, self.dir_path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue