aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-04-11 22:50:22 +0200
committerneodarz <neodarz@neodarz.net>2020-04-11 22:50:22 +0200
commit5a72f69fb66094cb9ad75410abaa4a6f970da0cb (patch)
treee05f6cc831160500517a9852a411ac10b8df4f54
parentcb0b33d55855f1dd99b73cb01e2c2af8b6a89d0d (diff)
downloadpyfunkwhale-5a72f69fb66094cb9ad75410abaa4a6f970da0cb.tar.xz
pyfunkwhale-5a72f69fb66094cb9ad75410abaa4a6f970da0cb.zip
Add ability to list favorites tracks
Diffstat (limited to '')
-rw-r--r--README.md3
-rw-r--r--pyfunkwhale/funkwhale.py23
2 files changed, 25 insertions, 1 deletions
diff --git a/README.md b/README.md
index 7d16a33..ef7c45d 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,7 @@ List of features implemented or planned:
- [x] License
- [x] List licences
- [x] Retrieve a single license
-- [ ] favorites
+- [\] favorites
+ - [x] List favorites
- [ ] Mark a given track as favorite
- [ ] Remove
diff --git a/pyfunkwhale/funkwhale.py b/pyfunkwhale/funkwhale.py
index 23d6412..38c388d 100644
--- a/pyfunkwhale/funkwhale.py
+++ b/pyfunkwhale/funkwhale.py
@@ -351,3 +351,26 @@ class Funkwhale(object):
params = self._build_params(arguments)
return self.client.call(f'/licenses/{_code}', 'get', params).json()
+
+ def favorites_tracks(self, q: str = None, user: str = None,
+ page: int = None, page_size: int = None) -> dict:
+ """
+ List favorites tracks
+
+ Parameters
+ ----------
+ q : str, optional
+ Search query used to filter favorites tracks
+ user : str, optional
+ Limit results to favorites tracks belonging to the given user
+ page : int, optional
+ Default value : 1
+ page_size : int, optional
+ Default value : 25
+ """
+
+ arguments = locals()
+
+ params = self._build_params(arguments)
+
+ return self.client.call(f'/favorites/tracks/', 'get', params).json()