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) {
|
private fun removeSongImpl(song: Song) {
|
||||||
val deletePosition = playingQueue.indexOf(song)
|
val deletePosition = playingQueue.indexOf(song)
|
||||||
playingQueue.removeAt(deletePosition)
|
if (deletePosition != -1) {
|
||||||
rePosition(deletePosition)
|
playingQueue.removeAt(deletePosition)
|
||||||
|
rePosition(deletePosition)
|
||||||
|
}
|
||||||
|
|
||||||
val originalDeletePosition = originalPlayingQueue.indexOf(song)
|
val originalDeletePosition = originalPlayingQueue.indexOf(song)
|
||||||
playingQueue.removeAt(originalDeletePosition)
|
if (originalDeletePosition != -1) {
|
||||||
rePosition(originalDeletePosition)
|
playingQueue.removeAt(originalDeletePosition)
|
||||||
|
rePosition(originalDeletePosition)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeSong(song: Song) {
|
fun removeSong(song: Song) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue