Improve album classification and modal data handling
Refines album/single classification in get_wishlist_stats by considering explicit 'album' type for short multi-track releases. Also updates openDownloadModalForRecentAlbum to include total_tracks and album_type in album data for more accurate processing.
This commit is contained in:
parent
238abb2aea
commit
b32871cf28
2 changed files with 6 additions and 1 deletions
|
|
@ -9331,6 +9331,9 @@ def get_wishlist_stats():
|
||||||
# Use track count (most accurate)
|
# Use track count (most accurate)
|
||||||
if total_tracks >= 6:
|
if total_tracks >= 6:
|
||||||
albums_count += 1
|
albums_count += 1
|
||||||
|
elif album_type == 'album' and total_tracks > 1:
|
||||||
|
# Respect explicit 'album' type for multi-track releases even if short
|
||||||
|
albums_count += 1
|
||||||
else:
|
else:
|
||||||
singles_count += 1
|
singles_count += 1
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -32853,7 +32853,9 @@ async function openDownloadModalForRecentAlbum(albumIndex) {
|
||||||
artists: artists,
|
artists: artists,
|
||||||
album: {
|
album: {
|
||||||
name: album.album_name,
|
name: album.album_name,
|
||||||
images: album.album_cover_url ? [{ url: album.album_cover_url }] : []
|
images: album.album_cover_url ? [{ url: album.album_cover_url }] : [],
|
||||||
|
total_tracks: albumData.total_tracks || albumData.tracks.length,
|
||||||
|
album_type: albumData.album_type || 'album'
|
||||||
},
|
},
|
||||||
duration_ms: track.duration_ms || 0
|
duration_ms: track.duration_ms || 0
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue