From 5ae1b4069a4b917429777c052413bc6c2463521f Mon Sep 17 00:00:00 2001 From: "Mr. Pixel Cat" Date: Sun, 14 Jan 2024 13:57:48 +0100 Subject: [PATCH] do not download covers when URL is an empty string --- ymd/ym_api/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ymd/ym_api/models.py b/ymd/ym_api/models.py index ee88038..9fa60f5 100644 --- a/ymd/ym_api/models.py +++ b/ymd/ym_api/models.py @@ -19,7 +19,9 @@ class CoverInfo: @classmethod def from_json(cls, data: dict) -> 'CoverInfo': og_image = data.get("ogImage") - return cls(f'https://{og_image}' if og_image is not None else None) + if og_image is None or og_image == "": + return cls(None) + return cls(f'https://{og_image}') @dataclass