From 7b3bfd8db4850dd96582bf847464464cd852b934 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:52:27 -0700 Subject: [PATCH] Fix artist discography miscategorizing albums as singles/EPs Track count heuristics were overriding the album_type field from Spotify/iTunes/Deezer, forcing any release with <=3 tracks into singles and 4-6 tracks into EPs regardless of actual album type. Now trusts the source's album_type directly. --- web_server.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web_server.py b/web_server.py index 851afef8..faf071a2 100644 --- a/web_server.py +++ b/web_server.py @@ -39221,15 +39221,14 @@ def get_spotify_artist_discography(artist_name): 'album_type': album.album_type.lower() } - # Categorize based on album type and track count - album_type = album.album_type.lower() + # Categorize based on album_type from source (Spotify/iTunes/Deezer) + album_type = album.album_type.lower() if album.album_type else 'album' - if album_type == 'single' or track_count <= 3: + if album_type == 'single': singles.append(release_data) - elif album_type == 'ep' or (track_count >= 4 and track_count <= 6): + elif album_type == 'ep': eps.append(release_data) elif album_type == 'compilation': - # Compilations go with albums albums.append(release_data) else: albums.append(release_data)