Added some documentation

This commit is contained in:
Malte Ried 2015-09-03 22:10:32 +02:00
parent 6ad53e1466
commit cd56286e86
2 changed files with 9 additions and 0 deletions

View file

@ -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())

View file

@ -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 \