Fixed IllegalStateException when deleting multiple songs

This commit is contained in:
Prathamesh More 2021-11-15 11:26:59 +05:30
parent b2dbfd3083
commit 97c56f9e57
6 changed files with 25 additions and 15 deletions

View file

@ -392,6 +392,15 @@ object MusicPlayerRemote : KoinComponent {
return false
}
@JvmStatic
fun removeFromQueue(songs: List<Song>): Boolean {
if (musicService != null) {
musicService!!.removeSongs(songs)
return true
}
return false
}
fun removeFromQueue(position: Int): Boolean {
if (musicService != null && position >= 0 && position < playingQueue.size) {
musicService!!.removeSong(position)