2022-12-20 19:11:33 -08:00
|
|
|
import type { AlbumListQuery, SongListQuery, AlbumDetailQuery } from './types';
|
2022-12-19 15:59:14 -08:00
|
|
|
|
|
|
|
|
export const queryKeys = {
|
|
|
|
|
albums: {
|
|
|
|
|
detail: (serverId: string, query: AlbumDetailQuery) =>
|
|
|
|
|
[serverId, 'albums', 'detail', query] as const,
|
|
|
|
|
list: (serverId: string, query: AlbumListQuery) => [serverId, 'albums', 'list', query] as const,
|
|
|
|
|
root: ['albums'],
|
|
|
|
|
serverRoot: (serverId: string) => [serverId, 'albums'],
|
|
|
|
|
songs: (serverId: string, query: SongListQuery) =>
|
|
|
|
|
[serverId, 'albums', 'songs', query] as const,
|
|
|
|
|
},
|
|
|
|
|
genres: {
|
|
|
|
|
list: (serverId: string) => [serverId, 'genres', 'list'] as const,
|
|
|
|
|
root: (serverId: string) => [serverId, 'genres'] as const,
|
|
|
|
|
},
|
2022-12-20 19:11:33 -08:00
|
|
|
musicFolders: {
|
|
|
|
|
list: (serverId: string) => [serverId, 'musicFolders', 'list'] as const,
|
|
|
|
|
},
|
2022-12-19 15:59:14 -08:00
|
|
|
server: {
|
|
|
|
|
root: (serverId: string) => [serverId] as const,
|
|
|
|
|
},
|
|
|
|
|
songs: {
|
|
|
|
|
list: (serverId: string, query: SongListQuery) => [serverId, 'songs', 'list', query] as const,
|
|
|
|
|
},
|
|
|
|
|
};
|