mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: bugs (#1464)
* fix: nextFMTrack 执行顺序 * fix: 当前歌曲无法播放时,播放下一首 * fix: windows下无法创建部分文件 * fix: windows下无法加载sqlite3
This commit is contained in:
parent
530581ba82
commit
24798a0bf3
4 changed files with 13 additions and 5 deletions
|
|
@ -171,7 +171,7 @@ export class Player {
|
|||
*/
|
||||
private async _fetchTrack(trackID: TrackID) {
|
||||
const response = await fetchTracksWithReactQuery({ ids: [trackID] })
|
||||
return response?.songs.length ? response.songs[0] : null
|
||||
return response?.songs?.length ? response.songs[0] : null
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -211,6 +211,7 @@ export class Player {
|
|||
const { audio, id } = await this._fetchAudioSource(this.trackID)
|
||||
if (!audio) {
|
||||
toast('无法播放此歌曲')
|
||||
this.nextTrack()
|
||||
return
|
||||
}
|
||||
if (this.trackID !== id) return
|
||||
|
|
@ -269,11 +270,11 @@ export class Player {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.fmTrackList.length === 0) await loadMoreTracks()
|
||||
this.fmTrackList.shift()
|
||||
if (this.fmTrackList.length === 0) await loadMoreTracks()
|
||||
this._playTrack()
|
||||
|
||||
this.fmTrackList.length === 0 ? await loadMoreTracks() : loadMoreTracks()
|
||||
this.fmTrackList.length <= 1 ? await loadMoreTracks() : loadMoreTracks()
|
||||
prefetchNextTrack()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue