Add duration comment

This commit is contained in:
Isira Seneviratne 2024-07-29 18:45:02 +05:30
parent 75475da053
commit a885a88e02
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ private fun PlaylistScreen(
) {
playlistInfo?.let {
val streams = streamFlow.collectAsLazyPagingItems()
// Paging's load states only indicate when loading is currently happening, not if it can/will
// happen. As such, the duration initially displayed will be the incomplete duration if more
// items can be loaded.
val totalDuration by remember {
derivedStateOf {
streams.itemSnapshotList.sumOf { it!!.duration }