From e2aabaaf0f8acbd64017ae89ddfa537d1d810350 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Apr 2020 18:44:24 +0200 Subject: Add abilty to retreive a single artist --- README.md | 2 +- pyfunkwhale/funkwhale.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f022bda..acf5eaf 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ List of features implemented or planned: - [x] Login with OAuth2 Authorization Code flow - [/] Artists - [x] List artists - - [ ] Retrieve a single artist + - [x] Retrieve a single artist - [ ] List available user libraries containing work from this artist - [ ] Albums - [ ] List albums diff --git a/pyfunkwhale/funkwhale.py b/pyfunkwhale/funkwhale.py index bca346a..99dcfae 100644 --- a/pyfunkwhale/funkwhale.py +++ b/pyfunkwhale/funkwhale.py @@ -40,3 +40,14 @@ class Funkwhale(object): params = self._build_params(arguments) return self.client.call('/artists/', 'get', params).json() + + def artist(self, _id, refresh: bool = False): + """ + Retrieve a single artist + """ + + arguments = locals() + + params = self._build_params(arguments) + + return self.client.call(f'/artists/{_id}', 'get', params).json() -- cgit v1.2.1