mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: bugs
This commit is contained in:
parent
3822b498a1
commit
b2f758f0c4
11 changed files with 40 additions and 67 deletions
|
|
@ -184,21 +184,18 @@ export default class {
|
|||
_getAudioSourceFromUnblockMusic(track) {
|
||||
if (process.env.IS_ELECTRON !== true) return null;
|
||||
const source = ipcRenderer.sendSync("unblock-music", track);
|
||||
if (store.state.settings.automaticallyCacheSongs && source?.url) {
|
||||
cacheTrack(track.id, source.url);
|
||||
}
|
||||
return source?.url;
|
||||
}
|
||||
_getAudioSource(track) {
|
||||
return this._getAudioSourceFromCache(String(track.id))
|
||||
.then((source) => {
|
||||
if (!source) return null;
|
||||
return source;
|
||||
return source ?? this._getAudioSourceFromNetease(track);
|
||||
})
|
||||
.then((source) => {
|
||||
if (source) return source;
|
||||
return this._getAudioSourceFromNetease(track);
|
||||
})
|
||||
.then((source) => {
|
||||
if (source) return source;
|
||||
return this._getAudioSourceFromUnblockMusic(track);
|
||||
return source ?? this._getAudioSourceFromUnblockMusic(track);
|
||||
});
|
||||
}
|
||||
_replaceCurrentTrack(
|
||||
|
|
@ -216,6 +213,7 @@ export default class {
|
|||
this._playAudioSource(source, autoplay);
|
||||
return source;
|
||||
} else {
|
||||
store.dispatch("showToast", `无法播放 ${track.name}`);
|
||||
ifUnplayableThen === "playNextTrack"
|
||||
? this.playNextTrack()
|
||||
: this.playPrevTrack();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue