Fixed a crash while removing songs from the queue
This commit is contained in:
parent
74d9d1db39
commit
5731b777f0
1 changed files with 8 additions and 4 deletions
|
@ -975,12 +975,16 @@ class MusicService : MediaBrowserServiceCompat(),
|
|||
|
||||
private fun removeSongImpl(song: Song) {
|
||||
val deletePosition = playingQueue.indexOf(song)
|
||||
playingQueue.removeAt(deletePosition)
|
||||
rePosition(deletePosition)
|
||||
if (deletePosition != -1) {
|
||||
playingQueue.removeAt(deletePosition)
|
||||
rePosition(deletePosition)
|
||||
}
|
||||
|
||||
val originalDeletePosition = originalPlayingQueue.indexOf(song)
|
||||
playingQueue.removeAt(originalDeletePosition)
|
||||
rePosition(originalDeletePosition)
|
||||
if (originalDeletePosition != -1) {
|
||||
playingQueue.removeAt(originalDeletePosition)
|
||||
rePosition(originalDeletePosition)
|
||||
}
|
||||
}
|
||||
|
||||
fun removeSong(song: Song) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue