mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: updates
This commit is contained in:
parent
0b4baa3eff
commit
222fb02355
77 changed files with 654 additions and 551 deletions
|
|
@ -155,19 +155,17 @@ function initOtherIpcMain() {
|
|||
})
|
||||
|
||||
/**
|
||||
* 缓存动态专辑封面
|
||||
* 获取动态封面
|
||||
*/
|
||||
on(IpcChannels.SetVideoCover, (event, args) => {
|
||||
const { id, url } = args
|
||||
cache.set(APIs.VideoCover, { id, url })
|
||||
})
|
||||
handle(IpcChannels.GetVideoCover, async (event, { id, name, artist }) => {
|
||||
const fromCache = cache.get(APIs.VideoCover, { id })
|
||||
if (fromCache) {
|
||||
return fromCache === 'no' ? undefined : fromCache
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取动态专辑封面
|
||||
*/
|
||||
on(IpcChannels.GetVideoCover, (event, args) => {
|
||||
const { id } = args
|
||||
event.returnValue = cache.get(APIs.VideoCover, { id })
|
||||
const fromApple = await getCoverVideo({ name, artist })
|
||||
cache.set(APIs.VideoCover, { id, url: fromApple || 'no' })
|
||||
return fromApple
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue