From 0962a74b7cf50dab0993acf79eca6e43d19cbdb9 Mon Sep 17 00:00:00 2001 From: DatLag Date: Wed, 3 Jan 2024 15:28:22 +0100 Subject: [PATCH] fix startpos of video if activated by double click negative value --- .../shared/ui/screen/video/VideoScreenComponent.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/ui/screen/video/VideoScreenComponent.kt b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/ui/screen/video/VideoScreenComponent.kt index 94c7fc47..a106f3e0 100644 --- a/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/ui/screen/video/VideoScreenComponent.kt +++ b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/ui/screen/video/VideoScreenComponent.kt @@ -57,7 +57,7 @@ class VideoScreenComponent( override val selectedSubtitle = MutableStateFlow(null) override val startingPos: StateFlow = dbEpisode.transform { - return@transform emit(it?.progress ?: 0L) + return@transform emit(max(it?.progress ?: 0L, 0L)) }.flowOn(ioDispatcher()).stateIn(ioScope(), SharingStarted.WhileSubscribed(), dbEpisode.value?.progress ?: 0L) private val dialogNavigation = SlotNavigation()