Merge pull request #37 from MrPixelCat/fix/empty-cover-url
fix: do not download covers when URL is an empty string
This commit is contained in:
commit
e8cc0b1164
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue