Compare commits
2 Commits
dev
...
0640ab9242
| Author | SHA1 | Date | |
|---|---|---|---|
| 0640ab9242 | |||
| b921cf9138 |
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "oxidespotify"
|
||||
version = "0.2.2"
|
||||
version = "0.2.0"
|
||||
description = "Client for Spotify API"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Miwory", email = "miwory.uwu@gmail.com" }]
|
||||
|
||||
@ -36,9 +36,7 @@ class SpotifyAPIClient(OxideHTTP):
|
||||
async def _process[T: BaseModel](
|
||||
self, req: Response | CachedResponse, schema: type[T] | None
|
||||
) -> T | None:
|
||||
if req.status_code == 204 or (
|
||||
req.status_code == 200 and schema is None
|
||||
):
|
||||
if req.status_code == 204:
|
||||
return None
|
||||
|
||||
if req.status_code >= 500:
|
||||
|
||||
@ -41,8 +41,7 @@ class SpotifyAuthClient(OxideHTTP):
|
||||
|
||||
data = await req.json()
|
||||
if req.status_code >= 400:
|
||||
err = f'{data["error"]}: {data["error_description"]}'
|
||||
raise s.ClientError(req.status_code, err)
|
||||
raise s.ClientError(req.status_code, data['error'])
|
||||
|
||||
return schema.model_validate(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user