From ea9119431cacf6b026bbddca4e718b248c7bb4ec Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Tue, 21 Apr 2026 07:09:23 +0000 Subject: [PATCH] use urlsearchparams instead of qs (#1970) --- src/renderer/api/subsonic/subsonic-api.ts | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/renderer/api/subsonic/subsonic-api.ts b/src/renderer/api/subsonic/subsonic-api.ts index e82be0c3e..4fcb60ab1 100644 --- a/src/renderer/api/subsonic/subsonic-api.ts +++ b/src/renderer/api/subsonic/subsonic-api.ts @@ -1,6 +1,5 @@ import { initClient, initContract } from '@ts-rest/core'; import axios, { AxiosError, AxiosRequestConfig, AxiosResponse, isAxiosError } from 'axios'; -import omitBy from 'lodash/omitBy'; import qs from 'qs'; import { z } from 'zod'; @@ -380,8 +379,26 @@ axiosClient.interceptors.response.use( const parsePath = (fullPath: string) => { const [path, params] = fullPath.split('?'); - const parsedParams = qs.parse(params, { arrayLimit: 99999, parameterLimit: 99999 }); - const notNilParams = omitBy(parsedParams, (value) => value === 'undefined' || value === 'null'); + const url = new URLSearchParams(params); + const notNilParams: Record = {}; + + for (const [key, value] of url) { + if (value === 'undefined' || value === 'null') { + continue; + } + + let realKey = key; + + if (key.includes('[') && key.includes(']')) { + realKey = key.split('[')[0]; + } + + if (realKey in notNilParams) { + notNilParams[realKey].push(value); + } else { + notNilParams[realKey] = [value]; + } + } return { params: notNilParams,