mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Use await query for db update
This commit is contained in:
parent
85400101e2
commit
44cc6d42b2
@ -178,7 +178,9 @@ object PlaylistsHelper {
|
|||||||
if (transaction.videos.size > 1) {
|
if (transaction.videos.size > 1) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
transaction.videos[1].thumbnailUrl?.let { transaction.playlist.thumbnailUrl = it }
|
transaction.videos[1].thumbnailUrl?.let { transaction.playlist.thumbnailUrl = it }
|
||||||
DatabaseHolder.Database.localPlaylistsDao().updatePlaylist(transaction.playlist)
|
awaitQuery {
|
||||||
|
DatabaseHolder.Database.localPlaylistsDao().updatePlaylist(transaction.playlist)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -185,17 +185,16 @@ class PlaylistFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val info = binding.playlistInfo.text.split(TextUtils.SEPARATOR)
|
val info = binding.playlistInfo.text.split(TextUtils.SEPARATOR)
|
||||||
val countInfo = getString(
|
|
||||||
R.string.videoCount,
|
|
||||||
playlistAdapter!!.itemCount.toString()
|
|
||||||
)
|
|
||||||
binding.playlistInfo.text = (
|
binding.playlistInfo.text = (
|
||||||
if (info.size == 2) {
|
if (info.size == 2) {
|
||||||
info[0] + TextUtils.SEPARATOR
|
info[0] + TextUtils.SEPARATOR
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
) + countInfo
|
) + getString(
|
||||||
|
R.string.videoCount,
|
||||||
|
playlistAdapter!!.itemCount.toString()
|
||||||
|
)
|
||||||
super.onItemRangeRemoved(positionStart, itemCount)
|
super.onItemRangeRemoved(positionStart, itemCount)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user