From 352ad5ff68e7ebd50e7c95c9ace2905511cf9be4 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Mon, 13 Apr 2026 09:37:50 -0700 Subject: [PATCH] Fix AcoustID test connection falsely failing for valid API keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fallback test (used when no audio files exist in the library) sends a dummy fingerprint to the AcoustID API. The API correctly rejects the dummy fingerprint but this is not error code 4 (invalid key), so the test was returning False instead of True. Any non-code-4 error from the fallback means the API key was accepted — only code 4 means a bad key. --- core/acoustid_client.py | 4 +++- web_server.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/acoustid_client.py b/core/acoustid_client.py index 81db2be7..80c64709 100644 --- a/core/acoustid_client.py +++ b/core/acoustid_client.py @@ -329,7 +329,9 @@ class AcoustIDClient: # Error code 4 is specifically "invalid API key" if error_code == 4: return False, "Invalid AcoustID API key - get one from https://acoustid.org/new-application" - return False, f"AcoustID API error: {error_msg}" + # Any other error (e.g. "invalid fingerprint") means the API key + # was accepted — the dummy test fingerprint is just rejected as expected + return True, "AcoustID API key is valid" # Status is 'ok' - key is valid return True, "AcoustID API key is valid" diff --git a/web_server.py b/web_server.py index 963ae1cb..3679f0a9 100644 --- a/web_server.py +++ b/web_server.py @@ -21601,6 +21601,7 @@ def get_version_info(): "• Docker compose includes optional slskd service block", "• Multi-stage Docker build reduces image size", "• MusicBrainz recording ID backfilled from Navidrome during scan", + "• AcoustID test connection no longer reports failure for valid API keys when library is empty", ], }, # v2.2 and earlier features moved to archive