Commit 7d29c71b authored by Georg Krause's avatar Georg Krause Committed by Agate
Browse files

Add option to show only artists from own libraries

parent aab99430
......@@ -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):
......
......@@ -157,6 +157,9 @@ def test_browse_artists_root(library):
models.Ref.directory(
uri="funkwhale:directory:artists:by-name", name="By name"
),
models.Ref.directory(
uri="funkwhale:directory:artists:scope-me", name="Own Content"
),
],
False,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment