From 39d11602ce47cfcbf15b4b22d5e247569cc46ea6 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Thu, 2 Apr 2026 18:09:11 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20Discogs=20format=20field=20parsing=20?= =?UTF-8?q?=E2=80=94=20handle=20list=20or=20string=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Search results return format as list ['Vinyl', 'LP'] while artist releases return comma-separated string — handle both - Fixes "'list' object has no attribute 'lower'" error --- core/discogs_client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/discogs_client.py b/core/discogs_client.py index 5983831d..0282001f 100644 --- a/core/discogs_client.py +++ b/core/discogs_client.py @@ -246,8 +246,13 @@ class Album: format_name = formats[0].get('name', '').lower() if formats else '' descriptions = [d.lower() for d in formats[0].get('descriptions', [])] if formats else [] - # Also check the comma-separated 'format' string from search/artist release endpoints - format_str = (release_data.get('format') or '').lower() + # Also check the 'format' field from search/artist release endpoints + # Can be a string "Vinyl, LP, Album" or a list ["Vinyl", "LP", "Album"] + raw_format = release_data.get('format') or '' + if isinstance(raw_format, list): + format_str = ', '.join(raw_format).lower() + else: + format_str = str(raw_format).lower() if 'single' in descriptions or 'single' in format_name or 'single' in format_str: album_type = 'single'