Skip to content

Commit

Permalink
remove deleted tracks from the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed Oct 23, 2020
1 parent e005450 commit 48056b9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import com.simplemobiletools.commons.extensions.getIntValue
import com.simplemobiletools.commons.extensions.getLongValue
import com.simplemobiletools.commons.extensions.getStringValue
import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.helpers.AlphanumericComparator
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.helpers.isOreoPlus
import com.simplemobiletools.commons.helpers.isQPlus
import com.simplemobiletools.musicplayer.databases.SongsDatabase
import com.simplemobiletools.musicplayer.helpers.*
import com.simplemobiletools.musicplayer.interfaces.PlaylistsDao
Expand Down Expand Up @@ -262,8 +265,8 @@ fun Context.removeQueueItems(tracks: List<Track>, callback: () -> Unit) {
tracks.forEach {
queueDAO.removeQueueItem(it.id)
MusicService.mTracks.remove(it)
callback()
}
callback()
}
}

Expand All @@ -279,6 +282,7 @@ fun Context.deleteTracks(tracks: List<Track>, callback: () -> Unit) {
}
}

removeQueueItems(tracks) {}
EventBus.getDefault().post(Events.TrackDeleted())
callback()
}

0 comments on commit 48056b9

Please sign in to comment.