feat: updates

This commit is contained in:
qier222 2022-07-11 11:06:41 +08:00
parent 0b4baa3eff
commit 222fb02355
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
77 changed files with 654 additions and 551 deletions

View file

@ -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
})
/**