From 5c94b87aeaeb56df9a238c6637fab9e9236b65a0 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:22:11 -0700 Subject: [PATCH] Pass lastfm api_key when enriching source-only artist response LastFMClient() with no args has no api_key -> get_artist_info silently returns None -> source artists never see bio/listeners/playcount even though my previous commit was supposedly fetching them. Now reads config_manager.get('lastfm.api_key') and only attempts the enrichment when the key is configured. Users without Last.fm credentials in Settings simply get image+name+badges+genres on source artists (everything except bio + stats), which is fine. --- web_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index 32aeb9e1..16600209 100644 --- a/web_server.py +++ b/web_server.py @@ -11399,9 +11399,10 @@ def _build_source_only_artist_detail(artist_id, artist_name, source): lastfm_url = None if resolved_name: try: - from core.lastfm_client import LastFMClient - lastfm = LastFMClient() - if lastfm and getattr(lastfm, 'enabled', True): + lastfm_api_key = config_manager.get('lastfm.api_key', '') or '' + if lastfm_api_key: + from core.lastfm_client import LastFMClient + lastfm = LastFMClient(api_key=lastfm_api_key) lf_info = lastfm.get_artist_info(resolved_name) if lf_info: bio_obj = lf_info.get('bio') or {}