From 214985482df876d9231172d716158d0501620fe8 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:51:21 -0700 Subject: [PATCH] Add Hydrabase as a searchable tab in multi-source enhanced search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hydrabase appears as a switchable source tab alongside Spotify/iTunes/ Deezer when connected and enabled. Added to alternate_sources list and enhanced-search/source endpoint. Tab only shows when Hydrabase is available — zero change when disconnected. --- web_server.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web_server.py b/web_server.py index ab0d85c9..31c64115 100644 --- a/web_server.py +++ b/web_server.py @@ -7002,6 +7002,8 @@ def enhanced_search(): # Determine which alternate sources are available (for frontend to fetch async) spotify_available = bool(spotify_client and spotify_client.is_spotify_authenticated()) + hydrabase_available = bool(hydrabase_client and hydrabase_client.is_connected() + and (dev_mode_enabled or config_manager.get('hydrabase.enabled', False))) alternate_sources = [] if primary_source != 'spotify' and spotify_available: alternate_sources.append('spotify') @@ -7009,6 +7011,8 @@ def enhanced_search(): alternate_sources.append('itunes') if primary_source != 'deezer': alternate_sources.append('deezer') + if primary_source != 'hydrabase' and hydrabase_available: + alternate_sources.append('hydrabase') logger.info(f"Enhanced search results ({primary_source}): {len(db_artists)} DB artists, " f"{len(primary_results['artists'])} artists, {len(primary_results['albums'])} albums, " @@ -7091,7 +7095,7 @@ def enhanced_search_source(source_name): Called asynchronously by the frontend after the primary search returns. Each source tab fires its own request so slow sources don't block fast ones. """ - if source_name not in ('spotify', 'itunes', 'deezer'): + if source_name not in ('spotify', 'itunes', 'deezer', 'hydrabase'): return jsonify({"error": f"Unknown source: {source_name}"}), 400 data = request.get_json() @@ -7111,6 +7115,11 @@ def enhanced_search_source(source_name): client = iTunesClient() elif source_name == 'deezer': client = _get_deezer_client() + elif source_name == 'hydrabase': + if hydrabase_client and hydrabase_client.is_connected(): + client = hydrabase_client + else: + return jsonify({"artists": [], "albums": [], "tracks": [], "available": False}) result = _enhanced_search_source(query, client) return jsonify(result)