Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mopidy_beets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class BeetsExtension(ext.Extension):

dist_name = "Mopidy-Beets"
ext_name = "beets"
version = __version__
Expand Down
1 change: 0 additions & 1 deletion mopidy_beets/browsers/albums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AlbumsCategoryBrowser(GenericBrowserBase):

field = None
sort_fields = None
label_fields = None
Expand Down
11 changes: 6 additions & 5 deletions mopidy_beets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def quote_and_encode(text):
quote_and_encode(key), quote_and_encode(value)
)
)
# Try to add a simple regex filter, if we look for a string.
# This will reduce the ressource consumption of the query on
# Try to add a simple regex filter, if we look for a string
# that doesn't contain a forward slash "/".
# This will reduce the resource consumption of the query on
# the server side (and for our 'exact' matching below).
if exact_text and isinstance(value, str):
if exact_text and isinstance(value, str) and "/" not in value:
regex_query = "^{}$".format(re.escape(value))
beets_query = "{}::{}".format(
quote_and_encode(key), quote_and_encode(regex_query)
Expand Down Expand Up @@ -200,7 +201,7 @@ def quote_and_encode(text):

@cache()
def get_artists(self):
""" returns all artists of one or more tracks """
"""returns all artists of one or more tracks"""
names = self._get("/artist/")["artist_names"]
names.sort()
# remove empty names
Expand All @@ -216,7 +217,7 @@ def get_sorted_unique_album_attributes(self, field):

@cache(ctl=32)
def _get_unique_attribute_values(self, base_url, field, sort_field):
""" returns all artists, genres, ... of tracks or albums """
"""returns all artists, genres, ... of tracks or albums"""
if not hasattr(self, "__legacy_beets_api_detected"):
try:
result = self._get(
Expand Down
3 changes: 1 addition & 2 deletions mopidy_beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@


class BeetsLibraryProvider(backend.LibraryProvider):

root_directory = models.Ref.directory(
uri="beets:library", name="Beets library"
)
Expand Down Expand Up @@ -95,7 +94,7 @@ def search(self, query=None, uris=None, exact=False):

self._validate_query(query)
search_list = []
for (field, values) in query.items():
for field, values in query.items():
for val in values:
# missing / unsupported fields: uri, performer
if field == "any":
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ select =
# pep8-naming rules
N
ignore =
# B019: Use of `functools.lru_cache` on methods can lead to memory leaks.
B019
# E203: whitespace before ':' (not PEP8 compliant)
E203
# E501: line too long (replaced by B950)
Expand Down