diff --git a/core/api_call_tracker.py b/core/api_call_tracker.py index 7499c956..b33c7927 100644 --- a/core/api_call_tracker.py +++ b/core/api_call_tracker.py @@ -22,6 +22,7 @@ RATE_LIMITS = { 'audiodb': 30, # MIN_API_INTERVAL=2.0s → ~30/min 'tidal': 120, # MIN_API_INTERVAL=0.5s → ~120/min 'qobuz': 60, # Variable throttle, ~60/min estimate + 'discogs': 60, # MIN_API_INTERVAL=1.0s with auth → ~60/min } # Display names for UI @@ -35,12 +36,13 @@ SERVICE_LABELS = { 'audiodb': 'AudioDB', 'tidal': 'Tidal', 'qobuz': 'Qobuz', + 'discogs': 'Discogs', } # Display order SERVICE_ORDER = [ 'spotify', 'itunes', 'deezer', 'lastfm', 'genius', - 'musicbrainz', 'audiodb', 'tidal', 'qobuz', + 'musicbrainz', 'audiodb', 'tidal', 'qobuz', 'discogs', ] diff --git a/web_server.py b/web_server.py index f2d69dd1..2f06d0df 100644 --- a/web_server.py +++ b/web_server.py @@ -4825,7 +4825,7 @@ def handle_settings(): if 'active_media_server' in new_settings: config_manager.set_active_media_server(new_settings['active_media_server']) - for service in ['spotify', 'plex', 'jellyfin', 'navidrome', 'soulseek', 'download_source', 'settings', 'database', 'metadata_enhancement', 'file_organization', 'playlist_sync', 'tidal', 'tidal_download', 'qobuz', 'hifi_download', 'deezer_download', 'listenbrainz', 'acoustid', 'lastfm', 'genius', 'import', 'lossy_copy', 'listening_stats', 'ui_appearance', 'youtube', 'content_filter', 'itunes', 'm3u_export', 'musicbrainz', 'deezer', 'audiodb', 'metadata', 'hydrabase', 'security']: + for service in ['spotify', 'plex', 'jellyfin', 'navidrome', 'soulseek', 'download_source', 'settings', 'database', 'metadata_enhancement', 'file_organization', 'playlist_sync', 'tidal', 'tidal_download', 'qobuz', 'hifi_download', 'deezer_download', 'listenbrainz', 'acoustid', 'lastfm', 'genius', 'import', 'lossy_copy', 'listening_stats', 'ui_appearance', 'youtube', 'content_filter', 'itunes', 'm3u_export', 'musicbrainz', 'deezer', 'audiodb', 'metadata', 'hydrabase', 'security', 'discogs']: if service in new_settings: for key, value in new_settings[service].items(): config_manager.set(f'{service}.{key}', value) diff --git a/webui/index.html b/webui/index.html index 2eb4a527..030e338b 100644 --- a/webui/index.html +++ b/webui/index.html @@ -4002,6 +4002,22 @@ + +
+

Discogs

+
+ + +
+
+
Get your free token from Discogs Developer Settings
+
Click "Generate new token" — no app registration needed. Provides 60 req/min and cover art in search results.
+
+
+

Metadata Source

@@ -4010,10 +4026,11 @@
-
When Spotify is not connected, this source provides artist, album, and track metadata. Hydrabase requires a connection configured above.
+
When Spotify is not connected, this source provides artist, album, and track metadata. Discogs requires a personal token configured above.
diff --git a/webui/static/script.js b/webui/static/script.js index 2e29f258..833d701b 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -5744,6 +5744,9 @@ async function loadSettingsData() { // Populate iTunes settings document.getElementById('itunes-country').value = settings.itunes?.country || 'US'; + // Populate Discogs settings + document.getElementById('discogs-token').value = settings.discogs?.token || ''; + // Populate Metadata source setting document.getElementById('metadata-fallback-source').value = settings.metadata?.fallback_source || 'itunes'; @@ -6802,6 +6805,9 @@ async function saveSettings(quiet = false) { embed_tags: document.getElementById('embed-itunes').checked, tags: _collectServiceTags('itunes') }, + discogs: { + token: document.getElementById('discogs-token').value, + }, metadata: { fallback_source: document.getElementById('metadata-fallback-source').value || 'itunes' }, @@ -37701,17 +37707,17 @@ function renderEnrichmentCards(enrichment) { const _rateMonitorState = {}; const _RATE_GAUGE_SERVICES = [ 'spotify', 'itunes', 'deezer', 'lastfm', 'genius', - 'musicbrainz', 'audiodb', 'tidal', 'qobuz', + 'musicbrainz', 'audiodb', 'tidal', 'qobuz', 'discogs', ]; const _RATE_GAUGE_LABELS = { spotify: 'Spotify', itunes: 'Apple Music', deezer: 'Deezer', lastfm: 'Last.fm', genius: 'Genius', musicbrainz: 'MusicBrainz', - audiodb: 'AudioDB', tidal: 'Tidal', qobuz: 'Qobuz', + audiodb: 'AudioDB', tidal: 'Tidal', qobuz: 'Qobuz', discogs: 'Discogs', }; const _RATE_GAUGE_COLORS = { spotify: '#1DB954', itunes: '#FC3C44', deezer: '#A238FF', lastfm: '#D51007', genius: '#FFFF64', musicbrainz: '#BA478F', - audiodb: '#00BCD4', tidal: '#00FFFF', qobuz: '#FF6B35', + audiodb: '#00BCD4', tidal: '#00FFFF', qobuz: '#FF6B35', discogs: '#333333', }; // SVG constants — 240° arc, gap at bottom