From 8cca52cd5f805bfd7fdcc3cb9af34801aa56cc96 Mon Sep 17 00:00:00 2001 From: Henri Dickson <90480431+alphatownsman@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:59:49 -0400 Subject: [PATCH] fix discogs without cover image --- catalog/sites/discogs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalog/sites/discogs.py b/catalog/sites/discogs.py index 83e1c04e..1f1a6c88 100644 --- a/catalog/sites/discogs.py +++ b/catalog/sites/discogs.py @@ -43,7 +43,7 @@ def scrape(self): ) media, disc_count = None, None - formats = release.get("formats") + formats = release.get("formats", []) if len(formats) == 1: media = formats[0].get("name") disc_count = formats[0].get("qty") @@ -57,7 +57,7 @@ def scrape(self): i["value"].replace(" ", "").replace("-", "") ) image_url = None - if len(release.get("images")) > 0: + if len(release.get("images", [])) > 0: image_url = release["images"][0].get("uri") pd = ResourceContent( metadata={