do not download covers when URL is an empty string

This commit is contained in:
Mr. Pixel Cat 2024-01-14 13:57:48 +01:00
parent 45855a7905
commit 5ae1b4069a

View file

@ -19,7 +19,9 @@ class CoverInfo:
@classmethod @classmethod
def from_json(cls, data: dict) -> 'CoverInfo': def from_json(cls, data: dict) -> 'CoverInfo':
og_image = data.get("ogImage") 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 @dataclass