feat: Use actively maintained unblockNeteaseMusic (#1105)

* refactor: use @unblockneteasemusic/server

we also use ipcMain.handle for unblock-music.

* refactor(utils/nativeAlert): remove the deprecated "remote"

* refactor(ipcMain): use our default sources

* style(config/vue): prettier

* feat(README): update for new UNM
This commit is contained in:
pan93412 2021-12-20 18:56:26 +08:00 committed by qier222
parent 0c6c89c7e0
commit e9f45c5352
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
7 changed files with 335 additions and 380 deletions

View file

@ -269,7 +269,7 @@ export default class {
});
}
}
_getAudioSourceFromUnblockMusic(track) {
async _getAudioSourceFromUnblockMusic(track) {
console.debug(`[debug][Player.js] _getAudioSourceFromUnblockMusic`);
if (
process.env.IS_ELECTRON !== true ||
@ -277,7 +277,7 @@ export default class {
) {
return null;
}
const source = ipcRenderer.sendSync('unblock-music', track);
const source = await ipcRenderer.invoke('unblock-music', track);
if (store.state.settings.automaticallyCacheSongs && source?.url) {
// TODO: 将unblockMusic字样换成真正的来源比如酷我咪咕等
cacheTrackSource(track, source.url, 128000, 'unblockMusic');