mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: 音乐库增加查看收藏的专辑/歌单/歌手功能
This commit is contained in:
parent
bbd5299341
commit
2e41001d02
6 changed files with 203 additions and 44 deletions
16
src/renderer/hooks/useUserAlbums.ts
Normal file
16
src/renderer/hooks/useUserAlbums.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import type { FetchUserAlbumsParams, FetchUserAlbumsResponse } from '@/api/user'
|
||||
import { UserApiNames, fetchUserAlbums } from '@/api/user'
|
||||
|
||||
export default function useUserAlbums(params: FetchUserAlbumsParams) {
|
||||
return useQuery(
|
||||
[UserApiNames.FETCH_USER_ALBUMS, params],
|
||||
() => fetchUserAlbums(params),
|
||||
{
|
||||
placeholderData: (): FetchUserAlbumsResponse =>
|
||||
window.ipcRenderer?.sendSync('getApiCacheSync', {
|
||||
api: 'album/sublist',
|
||||
query: params,
|
||||
}),
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue