From 74756a15d3a1453d471c4531f0573bf884e4c4ce Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Apr 2020 20:10:36 +0200 Subject: Add ability to list artist librairies --- README.md | 2 +- pyfunkwhale/funkwhale.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index acf5eaf..0ee4cec 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ List of features implemented or planned: - [/] Artists - [x] List artists - [x] Retrieve a single artist - - [ ] List available user libraries containing work from this artist + - [x] List available user libraries containing work from this artist - [ ] Albums - [ ] List albums - [ ] Retrieve a single album diff --git a/pyfunkwhale/funkwhale.py b/pyfunkwhale/funkwhale.py index c2ca78a..6b63227 100644 --- a/pyfunkwhale/funkwhale.py +++ b/pyfunkwhale/funkwhale.py @@ -54,3 +54,16 @@ class Funkwhale(object): params = self._build_params(arguments) return self.client.call(f'/artists/{_id}', 'get', params).json() + + def artist_librairies(self, _id: int, page: int = None, + page_size: int = None): + """ + List available user libraries containing work from this artist + """ + + arguments = locals() + + params = self._build_params(arguments) + + return self.client.call( + f'/artists/{_id}/libraries/', 'get', params).json() -- cgit v1.2.1