音源API更新 & 其他改动 (#1295)
## API ### kg源 - 增加歌单歌曲flac24bit显示 - 修复酷狗码只能导入500首的问题 - 更新排行榜 ### mg源 - 修复搜索不显示时长的问题 - 修复评论加载失败的问题 - 更新排行榜 ### tx源 - 增加热门评论图片显示 - 更新排行榜 ### wy源 - 更新排行榜 ## 其他 - 添加自定义源zlib模块的支持 --------- Co-authored-by: 彭狸花喵 <94218819+helloplhm-qwq@users.noreply.github.com> Co-authored-by: lyswhut <lyswhut@qq.com>
This commit is contained in:
co-authored by
彭狸花喵
lyswhut
parent
d0425fc0d6
commit
d970687ebe
@@ -1,5 +1,6 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
const needle = require('needle')
|
||||
const zlib = require('zlib')
|
||||
const { createCipheriv, publicEncrypt, constants, randomBytes, createHash } = require('crypto')
|
||||
const USER_API_RENDERER_EVENT_NAME = require('../rendererEvent/name')
|
||||
|
||||
@@ -233,8 +234,26 @@ contextBridge.exposeInMainWorld('lx', {
|
||||
return Buffer.from(buf, 'binary').toString(format)
|
||||
},
|
||||
},
|
||||
zlib: {
|
||||
inflate(buf) {
|
||||
return new Promise((resolve, reject) => {
|
||||
zlib.inflate(buf, (err, data) => {
|
||||
if (err) reject(new Error(err.message))
|
||||
else resolve(data)
|
||||
})
|
||||
})
|
||||
},
|
||||
deflate(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
zlib.deflate(data, (err, buf) => {
|
||||
if (err) reject(new Error(err.message))
|
||||
else resolve(buf)
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
version: '1.2.0',
|
||||
version: '1.3.0',
|
||||
// removeEvent(eventName, handler) {
|
||||
// if (!eventNames.includes(eventName)) return Promise.reject(new Error('The event is not supported: ' + eventName))
|
||||
// let handlers
|
||||
|
||||
Reference in New Issue
Block a user