From a885a88e02b8a393d2913b3bd7f3e46472db6b11 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Mon, 29 Jul 2024 18:45:02 +0530 Subject: [PATCH] Add duration comment --- .../main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt b/app/src/main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt index 01669e3c0..ddd978dc7 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt @@ -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 }