From 45f608bf1277a8d1459dfe85060ba051763c6ce7 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sat, 11 Apr 2026 12:53:49 +0300 Subject: [PATCH] Utilize cached spotify client in get_spotify_artist_discography --- web_server.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index 4485274c..f602e6ab 100644 --- a/web_server.py +++ b/web_server.py @@ -48810,15 +48810,20 @@ def start_oauth_callback_servers(): def get_spotify_artist_discography(artist_name): """Get complete artist discography from Spotify using proper matching""" try: - from core.spotify_client import SpotifyClient from core.matching_engine import MusicMatchingEngine print(f"🎵 Searching Spotify for artist: {artist_name}") - # Initialize clients - spotify_client = SpotifyClient() + # Reuse cached profile-aware Spotify client + spotify_client = get_spotify_client_for_profile() matching_engine = MusicMatchingEngine() + if not spotify_client: + return { + 'success': False, + 'error': 'Spotify client unavailable' + } + # Search for multiple potential matches (not just 1) artists = spotify_client.search_artists(artist_name, limit=5)