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.
This commit is contained in:
parent
b9732156cd
commit
7b3bfd8db4
1 changed files with 4 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue