diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index c50d2d572..5dff1c0f1 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -505,7 +505,7 @@ class Results(object): predicate. """ if self.sort: - # slow sort, must build the full list first + # Slow sort. Must build the full list first. objects = [] for row in self.rows: obj = self._generate_results(row) diff --git a/beets/dbcore/query.py b/beets/dbcore/query.py index 458bb7f91..b66496e2d 100644 --- a/beets/dbcore/query.py +++ b/beets/dbcore/query.py @@ -535,7 +535,7 @@ class Sort(object): class MultipleSort(Sort): - """ Sort class that combines several sort criteria. + """Sort class that combines several sort criteria. This implementation tries to implement as many sort operation in sql, falling back to python sort only when necessary. """ diff --git a/beets/dbcore/queryparse.py b/beets/dbcore/queryparse.py index 03536f8ca..b51194b33 100644 --- a/beets/dbcore/queryparse.py +++ b/beets/dbcore/queryparse.py @@ -150,4 +150,4 @@ def sort_from_strings(model_cls, sort_parts): sort = query.MultipleSort() for part in sort_parts: sort.add_criteria(construct_sort_part(model_cls, part)) - return sort \ No newline at end of file + return sort diff --git a/beets/library.py b/beets/library.py index 9e566626c..7270dc8c0 100644 --- a/beets/library.py +++ b/beets/library.py @@ -942,10 +942,10 @@ def get_query(val, model_cls): # Add path queries to aggregate query. if path_parts: query.subqueries += [PathQuery('path', s) for s in path_parts] - return (query, sort) + return query, sort elif isinstance(val, dbcore.Query): - return (val, None) + return val, None else: raise ValueError('query must be None or have type Query or str')