mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
improve similar items fallback, make ND album artist for song actually album artist, fix full screen race
This commit is contained in:
parent
2257e439a4
commit
14086ebc9c
15 changed files with 136 additions and 17 deletions
|
|
@ -131,7 +131,6 @@ axiosClient.defaults.paramsSerializer = (params) => {
|
|||
axiosClient.interceptors.response.use(
|
||||
(response) => {
|
||||
const data = response.data;
|
||||
|
||||
if (data['subsonic-response'].status !== 'ok') {
|
||||
// Suppress code related to non-linked lastfm or spotify from Navidrome
|
||||
if (data['subsonic-response'].error.code !== 0) {
|
||||
|
|
@ -161,12 +160,24 @@ const parsePath = (fullPath: string) => {
|
|||
};
|
||||
};
|
||||
|
||||
const silentlyTransformResponse = (data: any) => {
|
||||
const jsonBody = JSON.parse(data);
|
||||
const status = jsonBody ? jsonBody['subsonic-response']?.status : undefined;
|
||||
|
||||
if (status && status !== 'ok') {
|
||||
jsonBody['subsonic-response'].error.code = 0;
|
||||
}
|
||||
|
||||
return jsonBody;
|
||||
};
|
||||
|
||||
export const ssApiClient = (args: {
|
||||
server: ServerListItem | null;
|
||||
signal?: AbortSignal;
|
||||
silent?: boolean;
|
||||
url?: string;
|
||||
}) => {
|
||||
const { server, url, signal } = args;
|
||||
const { server, url, signal, silent } = args;
|
||||
|
||||
return initClient(contract, {
|
||||
api: async ({ path, method, headers, body }) => {
|
||||
|
|
@ -206,6 +217,8 @@ export const ssApiClient = (args: {
|
|||
...params,
|
||||
},
|
||||
signal,
|
||||
// In cases where we have a fallback, don't notify the error
|
||||
transformResponse: silent ? silentlyTransformResponse : undefined,
|
||||
url: `${baseUrl}/${api}`,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue