mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
feat: updates
This commit is contained in:
parent
c6c59b2cd9
commit
7ce516877e
63 changed files with 6591 additions and 1107 deletions
19
packages/web/api/hooks/useAppleMusicAlbum.ts
Normal file
19
packages/web/api/hooks/useAppleMusicAlbum.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { useQuery } from '@tanstack/react-query'
|
||||
import { fetchAppleMusicAlbum } from '../appleMusic'
|
||||
|
||||
const useAppleMusicAlbum = (id: string | number) => {
|
||||
return useQuery(
|
||||
['useAppleMusicAlbum', id],
|
||||
async () => {
|
||||
if (!id) return
|
||||
return fetchAppleMusicAlbum({ neteaseId: id })
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchInterval: false,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export default useAppleMusicAlbum
|
||||
19
packages/web/api/hooks/useAppleMusicArtist.ts
Normal file
19
packages/web/api/hooks/useAppleMusicArtist.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { useQuery } from '@tanstack/react-query'
|
||||
import { fetchAppleMusicArtist } from '../appleMusic'
|
||||
|
||||
const useAppleMusicArtist = (id: string | number) => {
|
||||
return useQuery(
|
||||
['useAppleMusicArtist', id],
|
||||
async () => {
|
||||
if (!id) return
|
||||
return fetchAppleMusicArtist({ neteaseId: id })
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchInterval: false,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export default useAppleMusicArtist
|
||||
Loading…
Add table
Add a link
Reference in a new issue