EspoirX / StarrySky

🔥A Powerful and Streamline MusicLibrary(一个丰富的音乐播放封装库,支持多种音频格式,完美解决你的问题。)
https://github.com/EspoirX/StarrySky
MIT License
1.39k stars 209 forks source link

修复随机播放仅在列表个别曲目中循环 #221

Closed yv-code closed 5 months ago

yv-code commented 5 months ago

具体原因:

PlaybackManager 的 onSkipToNext() 方法调用 mediaQueue.skipQueuePosition(),修改了 MediaQueueManager 的 currentIndex。接着 PlaybackManager 又会调用 onPlayMusicImpl() 方法,这个方法内会调用 mediaQueue.updateIndexBySongId(),再次修改 currentIndex

问题就在于 MediaQueueManager 的 updateIndexBySongId() 没有考虑是否为随机播放,一律从 MediaSourceProvider 的 songList 去找,就会出现问题。

在两个方法添加了判断。

EspoirX commented 5 months ago

好的,收到