mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Add music folders query
This commit is contained in:
parent
3399fc6bf6
commit
a354cab797
11 changed files with 143 additions and 55 deletions
|
|
@ -95,11 +95,13 @@ const authenticate = async (
|
|||
};
|
||||
|
||||
const getMusicFolderList = async (args: MusicFolderListArgs): Promise<JFMusicFolderList> => {
|
||||
const { signal } = args;
|
||||
const { server, signal } = args;
|
||||
const userId = useAuthStore.getState().currentServer?.userId;
|
||||
|
||||
const data = await api
|
||||
.get(`users/${userId}/items`, {
|
||||
headers: { 'X-MediaBrowser-Token': server?.credential },
|
||||
prefixUrl: server?.url,
|
||||
signal,
|
||||
})
|
||||
.json<JFMusicFolderListResponse>();
|
||||
|
|
@ -108,11 +110,7 @@ const getMusicFolderList = async (args: MusicFolderListArgs): Promise<JFMusicFol
|
|||
(folder) => folder.CollectionType === JFCollectionType.MUSIC,
|
||||
);
|
||||
|
||||
return {
|
||||
items: musicFolders,
|
||||
startIndex: data.StartIndex,
|
||||
totalRecordCount: data.TotalRecordCount,
|
||||
};
|
||||
return musicFolders;
|
||||
};
|
||||
|
||||
const getGenreList = async (args: GenreListArgs): Promise<JFGenreList> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue