diff --git a/web_server.py b/web_server.py index 79d34926..0f458af4 100644 --- a/web_server.py +++ b/web_server.py @@ -44407,9 +44407,13 @@ def get_current_seasonal_playlist(): return jsonify({"success": True, "tracks": []}) # itunes stores IDs in itunes_track_id; all other sources - # (spotify, deezer, discogs, hydrabase, etc.) use spotify_track_id - # as the generic ID column. - track_id_col = 'itunes_track_id' if active_source == 'itunes' else 'spotify_track_id' + # Each source stores IDs in its own column + if active_source == 'itunes': + track_id_col = 'itunes_track_id' + elif active_source == 'deezer': + track_id_col = 'deezer_track_id' + else: + track_id_col = 'spotify_track_id' tracks = [] with database._get_connection() as conn: cursor = conn.cursor() @@ -44538,10 +44542,13 @@ def get_seasonal_playlist(season_key): if not track_ids: return jsonify({"success": True, "tracks": []}) - # itunes stores IDs in itunes_track_id; all other sources - # (spotify, deezer, discogs, hydrabase, etc.) use spotify_track_id - # as the generic ID column. - track_id_col = 'itunes_track_id' if active_source == 'itunes' else 'spotify_track_id' + # Each source stores IDs in its own column + if active_source == 'itunes': + track_id_col = 'itunes_track_id' + elif active_source == 'deezer': + track_id_col = 'deezer_track_id' + else: + track_id_col = 'spotify_track_id' # Fetch track details from seasonal tracks or discovery pool (filtered by source) tracks = [] diff --git a/webui/static/pages-extra.js b/webui/static/pages-extra.js index 6aaf6694..a8722975 100644 --- a/webui/static/pages-extra.js +++ b/webui/static/pages-extra.js @@ -2515,7 +2515,7 @@ function _adlRenderBatchPanel() { if (batch.active > 0) phaseIcon = ''; } else if (batch.phase === 'complete') { const analysisTotal = batch.analysis_total || 0; - const alreadyOwned = analysisTotal > 0 ? analysisTotal - total : 0; + const alreadyOwned = analysisTotal > 0 ? Math.max(0, analysisTotal - total) : 0; let parts = [`${batch.completed} downloaded`]; if (alreadyOwned > 0) parts.push(`${alreadyOwned} owned`); if (batch.failed > 0) parts.push(`${batch.failed} failed`);