mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
Add initial genre list support
This commit is contained in:
parent
4d5085f230
commit
8029712b55
25 changed files with 968 additions and 41 deletions
|
|
@ -17,6 +17,7 @@ import type {
|
|||
RandomSongListQuery,
|
||||
LyricsQuery,
|
||||
LyricSearchQuery,
|
||||
GenreListQuery,
|
||||
} from './types';
|
||||
|
||||
export const splitPaginatedQuery = (key: any) => {
|
||||
|
|
@ -106,7 +107,18 @@ export const queryKeys: Record<
|
|||
root: (serverId: string) => [serverId, 'artists'] as const,
|
||||
},
|
||||
genres: {
|
||||
list: (serverId: string) => [serverId, 'genres', 'list'] as const,
|
||||
list: (serverId: string, query?: GenreListQuery) => {
|
||||
const { pagination, filter } = splitPaginatedQuery(query);
|
||||
if (query && pagination) {
|
||||
return [serverId, 'genres', 'list', filter, pagination] as const;
|
||||
}
|
||||
|
||||
if (query) {
|
||||
return [serverId, 'genres', 'list', filter] as const;
|
||||
}
|
||||
|
||||
return [serverId, 'genres', 'list'] as const;
|
||||
},
|
||||
root: (serverId: string) => [serverId, 'genres'] as const,
|
||||
},
|
||||
musicFolders: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue