🐛 Fixed still cover not got if animated failed

This commit is contained in:
GeoffreyCoulaud
2023-05-18 23:57:43 +02:00
parent 46f30d289b
commit c0e275ac5c

View File

@@ -67,7 +67,10 @@ class SGDBHelper:
res = requests.get(uri, headers=self.auth_headers, timeout=5)
match res.status_code:
case 200:
return res.json()["data"][0]["url"]
data = res.json()["data"]
if len(data) == 0:
raise SGDBNoImageFoundError()
return data[0]["url"]
case 401:
raise SGDBAuthError(res.json()["errors"][0])
case 404: