From c0e275ac5cdbe986b81c490c452616795a664eb7 Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Thu, 18 May 2023 23:57:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20still=20cover=20not=20go?= =?UTF-8?q?t=20if=20animated=20failed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/steamgriddb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/steamgriddb.py b/src/utils/steamgriddb.py index ec62b5d..172afd7 100644 --- a/src/utils/steamgriddb.py +++ b/src/utils/steamgriddb.py @@ -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: