Skip to content
Snippets Groups Projects

Add option to show only artists from own libraries

Merged Georg Krause requested to merge georgkrause/mopidy:own_artists into master
2 files
+ 21
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -161,6 +161,7 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
[
new_folder("Recent", "artists:recent"),
new_folder("By name", "artists:by-name"),
new_folder("Own Content", "artists:scope-me"),
],
False,
)
@@ -207,6 +208,23 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
]
return artists, True
if root == "scope-me":
if end:
# list albums
return (
self.browse_albums(uri_prefix=albums_uri_prefix, remaining=end),
True
)
payload = self.backend.client.list_artists(
{"ordering": "name", "page_size": 50, "scope": "me"}
)
uri_prefix = "funkwhale:directory:artists:scope-me"
artists = [
convert_to_artist(row, uri_prefix=uri_prefix, ref=True)
for row in self.backend.client.load_all(payload)
]
return artists, True
return [], False
def search(self, query=None, uris=None, exact=False):
Loading