mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
Add missing elements from Navidrome API
This commit is contained in:
parent
70c62c8b52
commit
52049ce163
2 changed files with 54 additions and 6 deletions
|
|
@ -66,6 +66,7 @@ export const contract = c.router({
|
|||
getAlbumList: {
|
||||
method: 'GET',
|
||||
path: 'album',
|
||||
query: ndType._parameters.albumList,
|
||||
responses: {
|
||||
200: resultWithHeaders(ndType._response.albumList),
|
||||
},
|
||||
|
|
@ -87,10 +88,19 @@ export const contract = c.router({
|
|||
getPlaylistList: {
|
||||
method: 'GET',
|
||||
path: 'playlist',
|
||||
query: ndType._parameters.playlistList,
|
||||
responses: {
|
||||
200: resultWithHeaders(ndType._response.playlistList),
|
||||
},
|
||||
},
|
||||
getPlaylistSongList: {
|
||||
method: 'GET',
|
||||
path: 'playlist/:id/tracks',
|
||||
query: ndType._parameters.songList,
|
||||
responses: {
|
||||
200: resultWithHeaders(ndType._response.playlistSongList),
|
||||
},
|
||||
},
|
||||
getSongDetail: {
|
||||
method: 'GET',
|
||||
path: 'song/:id',
|
||||
|
|
@ -109,6 +119,7 @@ export const contract = c.router({
|
|||
getUserList: {
|
||||
method: 'GET',
|
||||
path: 'user',
|
||||
query: ndType._parameters.userList,
|
||||
responses: {
|
||||
200: resultWithHeaders(ndType._response.userList),
|
||||
},
|
||||
|
|
@ -164,7 +175,9 @@ axiosClient.interceptors.response.use(
|
|||
},
|
||||
);
|
||||
|
||||
export const ndApiClient = (server: ServerListItem | string) => {
|
||||
export const ndApiClient = (args: { server: ServerListItem | string; signal?: AbortSignal }) => {
|
||||
const { server, signal } = args;
|
||||
|
||||
return initClient(contract, {
|
||||
api: async ({ path, method, headers, body }) => {
|
||||
let baseUrl: string | undefined;
|
||||
|
|
@ -186,6 +199,7 @@ export const ndApiClient = (server: ServerListItem | string) => {
|
|||
...(token && { 'x-nd-authorization': `Bearer ${token}` }),
|
||||
},
|
||||
method: method as Method,
|
||||
signal,
|
||||
url: `${baseUrl}/${path}`,
|
||||
});
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue