Fix exoplayer crash (regression)
This commit is contained in:
parent
e13d083a8c
commit
b35b3b2df2
1 changed files with 3 additions and 2 deletions
|
@ -182,10 +182,11 @@ fun Controls(
|
|||
colorFilter = ColorFilter.tint(colorPalette.favoritesIcon),
|
||||
modifier = Modifier
|
||||
.clickable {
|
||||
val currentMediaItem = binder.player.currentMediaItem
|
||||
query {
|
||||
if (Database.like(mediaId, if (likedAt == null) System.currentTimeMillis() else null) == 0) {
|
||||
binder.player.currentMediaItem?.takeIf { it.mediaId == mediaId }?.let { mediaItem ->
|
||||
Database.insert(mediaItem, Song::toggleLike)
|
||||
currentMediaItem?.takeIf { it.mediaId == mediaId }?.let {
|
||||
Database.insert(currentMediaItem, Song::toggleLike)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue