mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
fix: revert flake8 change
This commit is contained in:
parent
b9068e3fbd
commit
42e5844564
2 changed files with 6 additions and 5 deletions
|
|
@ -332,7 +332,7 @@ class Distance(object):
|
|||
self._penalties = {}
|
||||
|
||||
@LazyClassProperty
|
||||
def _weights(self, cls): # noqa
|
||||
def _weights(cls): # noqa
|
||||
"""A dictionary from keys to floating-point weights.
|
||||
"""
|
||||
weights_view = config['match']['distance_weights']
|
||||
|
|
|
|||
|
|
@ -105,17 +105,18 @@ class SmartPlaylistPlugin(BeetsPlugin):
|
|||
|
||||
playlist_data = (playlist['name'],)
|
||||
try:
|
||||
for key, model in (('query', Item), ('album_query', Album)):
|
||||
for key, model_cls in (('query', Item),
|
||||
('album_query', Album)):
|
||||
qs = playlist.get(key)
|
||||
if qs is None:
|
||||
query_and_sort = None, None
|
||||
elif isinstance(qs, six.string_types):
|
||||
query_and_sort = parse_query_string(qs, model)
|
||||
query_and_sort = parse_query_string(qs, model_cls)
|
||||
elif len(qs) == 1:
|
||||
query_and_sort = parse_query_string(qs[0], model)
|
||||
query_and_sort = parse_query_string(qs[0], model_cls)
|
||||
else:
|
||||
# multiple queries and sorts
|
||||
queries, sorts = zip(*(parse_query_string(q, model)
|
||||
queries, sorts = zip(*(parse_query_string(q, model_cls)
|
||||
for q in qs))
|
||||
query = OrQuery(queries)
|
||||
final_sorts = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue