add new artist list

This commit is contained in:
jeffvli
2025-11-14 00:11:31 -08:00
parent 164332d752
commit 8a8de4a1b6
18 changed files with 808 additions and 556 deletions
@@ -51,15 +51,29 @@ export const artistsQueries = {
...args.options,
});
},
artistListCount: (args: QueryHookArgs<ListCountQuery<ArtistListQuery>>) => {
artistList: (args: QueryHookArgs<ArtistListQuery>) => {
return queryOptions({
queryFn: ({ signal }) => {
return api.controller.getArtistListCount({
return api.controller.getArtistList({
apiClientProps: { serverId: args.serverId, signal },
query: args.query,
});
},
queryKey: queryKeys.albumArtists.count(
queryKey: queryKeys.artists.list(args.serverId, args.query),
...args.options,
});
},
artistListCount: (args: QueryHookArgs<ListCountQuery<ArtistListQuery>>) => {
return queryOptions({
queryFn: ({ signal }) => {
return api.controller
.getArtistList({
apiClientProps: { serverId: args.serverId, signal },
query: { ...args.query, limit: 1, startIndex: 0 },
})
.then((result) => result?.totalRecordCount ?? 0);
},
queryKey: queryKeys.artists.count(
args.serverId,
Object.keys(args.query).length === 0 ? undefined : args.query,
),