diff --git a/webui/static/script.js b/webui/static/script.js index caaa10a8..1e0407aa 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -3131,7 +3131,9 @@ async function closeDownloadMissingModal(playlistId) { // Clean up artist download if this is an artist album playlist if (playlistId.startsWith('artist_album_')) { + console.log(`๐งน [MODAL CLOSE] Cleaning up artist download for completed modal: ${playlistId}`); cleanupArtistDownload(playlistId); + console.log(`โ [MODAL CLOSE] Artist download cleanup completed for: ${playlistId}`); } cleanupDownloadProcess(playlistId); @@ -10711,13 +10713,20 @@ function updateArtistDownloadsSection() { * Show or update the artist downloads section in search state */ function showArtistDownloadsSection() { + console.log(`๐ [SHOW] showArtistDownloadsSection() called - refreshing artist bubbles`); + console.log(`๐ [SHOW] Current view: ${artistsPageState.currentView}, artistDownloadBubbles count: ${Object.keys(artistDownloadBubbles).length}`); + // Only show in search state if (artistsPageState.currentView !== 'search') { + console.log(`โญ๏ธ [SHOW] Skipping - not in search state (current: ${artistsPageState.currentView})`); return; } const artistsSearchState = document.getElementById('artists-search-state'); - if (!artistsSearchState) return; + if (!artistsSearchState) { + console.log(`โญ๏ธ [SHOW] Skipping - no artists-search-state element found`); + return; + } let downloadsSection = document.getElementById('artist-downloads-section'); @@ -10782,8 +10791,8 @@ function createArtistBubbleCard(artistBubbleData) { const completedCount = downloads.filter(d => d.status === 'view_results').length; const allCompleted = activeCount === 0 && completedCount > 0; - // Debug logging for bubble card creation - console.log(`๐ต Creating bubble for ${artist.name}:`, { + // Enhanced debug logging for bubble card creation and green checkmark detection + console.log(`๐ต [BUBBLE] Creating bubble for ${artist.name}:`, { totalDownloads: downloads.length, activeCount, completedCount, @@ -10791,6 +10800,16 @@ function createArtistBubbleCard(artistBubbleData) { downloadStatuses: downloads.map(d => `${d.album.name}: ${d.status}`) }); + // CRITICAL: Green checkmark detection logging + if (allCompleted) { + console.log(`๐ข [BUBBLE] GREEN CHECKMARK DETECTED for ${artist.name} - all ${downloads.length} downloads completed`); + console.log(`โ [BUBBLE] This bubble will have 'all-completed' class and green checkmark`); + } else if (activeCount === 0 && completedCount === 0) { + console.log(`โญ [BUBBLE] No active or completed downloads for ${artist.name} - this shouldn't happen`); + } else { + console.log(`โณ [BUBBLE] Still waiting for completion: ${activeCount} active, ${completedCount} completed`); + } + const imageUrl = artist.image_url || ''; const backgroundStyle = imageUrl ? `background-image: url('${imageUrl}');` : @@ -10849,6 +10868,9 @@ function monitorArtistDownload(artistId, virtualPlaylistId) { const allCompleted = artistDownloads.every(d => d.status === 'view_results'); if (allCompleted) { console.log(`๐ข All downloads completed for ${artistDownloadBubbles[artistId].artist.name} - green checkmark should appear`); + console.log(`๐ฏ [STATUS DEBUG] Green checkmark trigger - forcing bubble refresh`); + // Force immediate bubble refresh to show green checkmark + setTimeout(updateArtistDownloadsSection, 100); } } @@ -10869,7 +10891,8 @@ function openArtistDownloadModal(artistId) { const artistBubbleData = artistDownloadBubbles[artistId]; if (!artistBubbleData || artistDownloadModalOpen) return; - console.log(`๐ต Opening artist download modal for: ${artistBubbleData.artist.name}`); + console.log(`๐ต [MODAL OPEN] Opening artist download modal for: ${artistBubbleData.artist.name}`); + console.log(`๐ [MODAL OPEN] Current download statuses:`, artistBubbleData.downloads.map(d => `${d.album.name}: ${d.status}`)); artistDownloadModalOpen = true; const modal = document.createElement('div'); @@ -10906,6 +10929,9 @@ function createArtistDownloadItem(download, index) { const buttonText = status === 'view_results' ? 'View Results' : 'View Progress'; const buttonClass = status === 'view_results' ? 'completed' : 'active'; + // Enhanced debugging for button text generation + console.log(`๐ฏ [BUTTON] Creating item for ${album.name}: status='${status}' โ buttonText='${buttonText}'`); + return `