From ac0c074d4b0591a459d53e6c6aadd52516e34055 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 28 Apr 2026 21:17:44 -0700 Subject: [PATCH] fix undefined / null parameter string for Subsonic (#1978) --- src/renderer/api/subsonic/subsonic-api.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/renderer/api/subsonic/subsonic-api.ts b/src/renderer/api/subsonic/subsonic-api.ts index 4fcb60ab1..256f3c4f3 100644 --- a/src/renderer/api/subsonic/subsonic-api.ts +++ b/src/renderer/api/subsonic/subsonic-api.ts @@ -376,6 +376,16 @@ axiosClient.interceptors.response.use( }, ); +const keysToSkipEmptyCheck = new Set([ + 'artist', + 'comment', + 'genre', + 'name', + 'query', + 'u', + 'username', +]); + const parsePath = (fullPath: string) => { const [path, params] = fullPath.split('?'); @@ -383,7 +393,7 @@ const parsePath = (fullPath: string) => { const notNilParams: Record = {}; for (const [key, value] of url) { - if (value === 'undefined' || value === 'null') { + if (!keysToSkipEmptyCheck.has(key) && (value === 'undefined' || value === 'null')) { continue; }