Skip to content

Commit 9e5e9a2

Browse files
committed
Query case sensitivity depends on the query (#1586)
This could match intuition a little more closely and also avoids a coupling with the configuration.
1 parent 9bf95bf commit 9e5e9a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

beets/library.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ class PathQuery(dbcore.FieldQuery):
5353
escape_char = b'\\'
5454

5555
def __init__(self, field, pattern, fast=True, case_sensitive=None):
56-
"""Create a path query.
56+
"""Create a path query. `pattern` must be a path, either to a
57+
file or a directory.
5758
5859
`case_sensitive` can be a bool or `None`, indicating that the
59-
behavior should depend on the platform (the default).
60+
behavior should depend on the filesystem.
6061
"""
6162
super(PathQuery, self).__init__(field, pattern, fast)
6263

6364
# By default, the case sensitivity depends on the filesystem
64-
# the library is located on.
65+
# that the query path is located on.
6566
if case_sensitive is None:
66-
case_sensitive = beets.util.is_filesystem_case_sensitive(
67-
beets.config['directory'].get())
67+
case_sensitive = beets.util.is_filesystem_case_sensitive(pattern)
6868
self.case_sensitive = case_sensitive
6969

7070
# Use a normalized-case pattern for case-insensitive matches.

0 commit comments

Comments
 (0)