From 51871fd296afb8f5b33877fba3cf5613d8b4eee1 Mon Sep 17 00:00:00 2001 From: zebra Date: Thu, 12 Jun 2025 16:28:23 -0700 Subject: [PATCH] Additional tweaks to search_artist function. --- musicfetch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/musicfetch b/musicfetch index fe45096..b8a8f13 100644 --- a/musicfetch +++ b/musicfetch @@ -79,7 +79,11 @@ def search_artist(name, timeout_seconds=15): ) resp.raise_for_status() results = resp.json() - return results[0] if results else None + if results: + artist = results[0] + print(f"Found artist: {artist.get('artistName') or artist.get('title')}") + return artist + return None except Timeout: print(f"Lidarr artist search timed out after {timeout_seconds} seconds.") return None