diff --git a/beets/library.py b/beets/library.py index 0f9fddafe..9d2a1b857 100644 --- a/beets/library.py +++ b/beets/library.py @@ -60,6 +60,8 @@ class PathQuery(dbcore.FieldQuery): """ super(PathQuery, self).__init__(field, pattern, fast) + # By default, the case sensitivity depends on the filesystem + # the library is located on. if case_sensitive is None: case_sensitive = beets.util.is_filesystem_case_sensitive( beets.config['directory'].get()) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index f0304fc45..ed1320807 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -762,6 +762,13 @@ def interactive_open(target, command=None): def is_filesystem_case_sensitive(path): + """Checks if the filesystem at the given path is case sensitive. + If the path does not exist, a case sensitive file system is + assumed if the system is not windows. + + :param path: The path to check for case sensitivity. + :return: True if the file system is case sensitive, False else. + """ if os.path.exists(path): # Check if the path to the library exists in lower and upper case if os.path.exists(path.lower()) and \