mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
handle playback on new artist list
This commit is contained in:
parent
b9611589ba
commit
4a3604b1a8
12 changed files with 121 additions and 31 deletions
|
|
@ -146,7 +146,7 @@ export const getAlbumArtistSongsById = async (args: {
|
|||
const { id, queryClient, server, query } = args;
|
||||
|
||||
const queryFilter: SongListQuery = {
|
||||
artistIds: id || [],
|
||||
albumArtistIds: id || [],
|
||||
sortBy: SongListSort.ALBUM_ARTIST,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
|
|
@ -174,6 +174,43 @@ export const getAlbumArtistSongsById = async (args: {
|
|||
return res;
|
||||
};
|
||||
|
||||
export const getArtistSongsById = async (args: {
|
||||
id: string[];
|
||||
query?: Partial<SongListQuery>;
|
||||
queryClient: QueryClient;
|
||||
server: ServerListItem;
|
||||
}) => {
|
||||
const { id, queryClient, server, query } = args;
|
||||
|
||||
const queryFilter: SongListQuery = {
|
||||
artistIds: id,
|
||||
sortBy: SongListSort.ALBUM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
...query,
|
||||
};
|
||||
|
||||
const queryKey = queryKeys.songs.list(server?.id, queryFilter);
|
||||
|
||||
const res = await queryClient.fetchQuery(
|
||||
queryKey,
|
||||
async ({ signal }) =>
|
||||
api.controller.getSongList({
|
||||
apiClientProps: {
|
||||
server,
|
||||
signal,
|
||||
},
|
||||
query: queryFilter,
|
||||
}),
|
||||
{
|
||||
cacheTime: 1000 * 60,
|
||||
staleTime: 1000 * 60,
|
||||
},
|
||||
);
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getSongsByQuery = async (args: {
|
||||
query?: Partial<SongListQuery>;
|
||||
queryClient: QueryClient;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue