From 9e5e9a23ab828fa84d0f6025345ac7ed5acc2a3d Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 7 Oct 2015 15:53:26 -0700 Subject: [PATCH] Query case sensitivity depends on the query (#1586) This could match intuition a little more closely and also avoids a coupling with the configuration. --- beets/library.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beets/library.py b/beets/library.py index 18b739902..d1952f691 100644 --- a/beets/library.py +++ b/beets/library.py @@ -53,18 +53,18 @@ class PathQuery(dbcore.FieldQuery): escape_char = b'\\' def __init__(self, field, pattern, fast=True, case_sensitive=None): - """Create a path query. + """Create a path query. `pattern` must be a path, either to a + file or a directory. `case_sensitive` can be a bool or `None`, indicating that the - behavior should depend on the platform (the default). + behavior should depend on the filesystem. """ super(PathQuery, self).__init__(field, pattern, fast) # By default, the case sensitivity depends on the filesystem - # the library is located on. + # that the query path is located on. if case_sensitive is None: - case_sensitive = beets.util.is_filesystem_case_sensitive( - beets.config['directory'].get()) + case_sensitive = beets.util.is_filesystem_case_sensitive(pattern) self.case_sensitive = case_sensitive # Use a normalized-case pattern for case-insensitive matches.