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
08abf8229f
commit
fb21405bf9
33 changed files with 699 additions and 361 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { fetchAlbum } from '@/api/album'
|
||||
import { AlbumApiNames } from '@/api/album'
|
||||
import type { FetchAlbumParams } from '@/api/album'
|
||||
import type { FetchAlbumParams, FetchAlbumResponse } from '@/api/album'
|
||||
import reactQueryClient from '@/utils/reactQueryClient'
|
||||
|
||||
const fetch = async (params: FetchAlbumParams, noCache?: boolean) => {
|
||||
|
|
@ -17,7 +17,14 @@ export default function useAlbum(params: FetchAlbumParams, noCache?: boolean) {
|
|||
() => fetch(params, noCache),
|
||||
{
|
||||
enabled: !!params.id,
|
||||
staleTime: Infinity,
|
||||
staleTime: 24 * 60 * 60 * 1000, // 24 hours
|
||||
placeholderData: (): FetchAlbumResponse =>
|
||||
window.ipcRenderer.sendSync('getApiCacheSync', {
|
||||
api: 'album',
|
||||
query: {
|
||||
id: params.id,
|
||||
},
|
||||
}),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue