diff --git a/allstarr/wwwroot/index.html b/allstarr/wwwroot/index.html index 0f589bf..3e9d5fc 100644 --- a/allstarr/wwwroot/index.html +++ b/allstarr/wwwroot/index.html @@ -1176,6 +1176,16 @@ const externalMissing = p.externalMissing || 0; const totalInJellyfin = p.totalInJellyfin || 0; + // Debug: Log the raw data + console.log(`Playlist ${p.name}:`, { + spotifyTotal, + localCount, + externalMatched, + externalMissing, + totalInJellyfin, + rawData: p + }); + // Build detailed stats string let statsHtml = `${spotifyTotal}`; @@ -1202,9 +1212,7 @@ const completionColor = completionPct === 100 ? 'var(--success)' : completionPct >= 80 ? 'var(--accent)' : 'var(--warning)'; // Debug logging - if (p.name && (localCount > 0 || externalMatched > 0)) { - console.log(`Playlist ${p.name}: total=${spotifyTotal}, local=${localCount} (${localPct}%), external=${externalMatched} (${externalPct}%)`); - } + console.log(`Progress bar for ${p.name}: local=${localPct}%, external=${externalPct}%, total=${completionPct}%`); return ` @@ -1508,6 +1516,27 @@ if (res.ok) { showToast(`✓ ${data.message}`, 'success'); // Refresh the playlists table after a delay to show updated counts + setTimeout(fetchPlaylists, 2000); + } else { + showToast(data.error || 'Failed to match tracks', 'error'); + } + } catch (error) { + showToast('Failed to match tracks', 'error'); + } + } + + function searchProvider(query, provider) { + // Provider-specific search URLs + const searchUrls = { + 'Deezer': `https://www.deezer.com/search/${encodeURIComponent(query)}`, + 'Qobuz': `https://www.qobuz.com/us-en/search?q=${encodeURIComponent(query)}`, + 'SquidWTF': `https://triton.squid.wtf/search/?s=${encodeURIComponent(query)}`, + 'default': `https://www.google.com/search?q=${encodeURIComponent(query + ' music')}` + }; + + const url = searchUrls[provider] || searchUrls['default']; + window.open(url, '_blank'); + } setTimeout(fetchPlaylists, 3000); } else { showToast(data.error || 'Failed to match tracks', 'error'); @@ -1748,7 +1777,7 @@
${t.album ? escapeHtml(t.album) : ''} ${t.isrc ? '
ISRC: ' + t.isrc + '' : ''} - ${t.isLocal === false && t.searchQuery ? '
🔍 Search: ' + escapeHtml(t.searchQuery) + '' : ''} + ${t.isLocal === false && t.searchQuery && t.externalProvider ? '
🔍 Search: ' + escapeHtml(t.searchQuery) + '' : ''}
`;