fix: update stored progress handling to check resumable state

This commit is contained in:
tapframe 2026-04-23 01:54:05 +05:30
parent c9674812c3
commit 1eb82c55e7

View file

@ -131,7 +131,9 @@ fun StreamsScreen(
} else { } else {
watchProgressUiState.byVideoId[videoId] watchProgressUiState.byVideoId[videoId]
} }
val storedProgressFraction = storedProgress?.progressPercent val storedProgressFraction = storedProgress
?.takeIf { it.isResumable }
?.progressPercent
?.takeIf { it > 0f } ?.takeIf { it > 0f }
?.let { explicitPercent -> (explicitPercent / 100f).coerceIn(0f, 1f) } ?.let { explicitPercent -> (explicitPercent / 100f).coerceIn(0f, 1f) }
val effectiveResumeProgressFraction = if (startFromBeginning) { val effectiveResumeProgressFraction = if (startFromBeginning) {
@ -148,7 +150,7 @@ fun StreamsScreen(
if (startFromBeginning) { if (startFromBeginning) {
null null
} else { } else {
(resumePositionMs ?: storedProgress?.lastPositionMs)?.takeIf { it > 0L } (resumePositionMs ?: storedProgress?.takeIf { it.isResumable }?.lastPositionMs)?.takeIf { it > 0L }
} }
} }