mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
feat: add artist radio and track radio (in context menu) (#1437)
* Add API support for artist radio and track radio features * Add translation strings and settings UI for artist radio count --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { controller } from '/@/renderer/api/controller';
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { QueryHookArgs } from '/@/renderer/lib/react-query';
|
||||
import {
|
||||
ArtistRadioQuery,
|
||||
GetQueueQuery,
|
||||
ListCountQuery,
|
||||
RandomSongListQuery,
|
||||
@@ -13,6 +14,21 @@ import {
|
||||
} from '/@/shared/types/domain-types';
|
||||
|
||||
export const songsQueries = {
|
||||
artistRadio: (args: QueryHookArgs<ArtistRadioQuery>) => {
|
||||
return queryOptions({
|
||||
queryFn: ({ signal }) => {
|
||||
return api.controller.getArtistRadio({
|
||||
apiClientProps: { serverId: args.serverId, signal },
|
||||
query: {
|
||||
artistId: args.query.artistId,
|
||||
count: args.query.count ?? 20,
|
||||
},
|
||||
});
|
||||
},
|
||||
queryKey: queryKeys.songs.artistRadio(args.serverId, args.query),
|
||||
...args.options,
|
||||
});
|
||||
},
|
||||
getQueue: (args: QueryHookArgs<GetQueueQuery>) => {
|
||||
return queryOptions({
|
||||
queryFn: ({ signal }) => {
|
||||
|
||||
Reference in New Issue
Block a user