Simplify params handling for endpoints

This commit is contained in:
François Charette 2020-12-05 21:49:00 +01:00
parent 6aa3f5fb0f
commit 902c5b8ee2

View File

@ -43,10 +43,6 @@ class Client:
params = {"track_id": kwargs["id"]}
elif epoint == "album/get":
params = {"album_id": kwargs["id"]}
elif epoint == "track/search":
params = {"query": kwargs["query"], "limit": kwargs["limit"]}
elif epoint == "album/search":
params = {"query": kwargs["query"], "limit": kwargs["limit"]}
elif epoint == "playlist/get":
params = {
"extra": "tracks",
@ -94,6 +90,8 @@ class Client:
"format_id": fmt_id,
"intent": "stream",
}
else:
params=kwargs
r = self.session.get(self.base + epoint, params=params)
# Do ref header.
if epoint == "user/login":