mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
fix: update stored progress handling to check resumable state
This commit is contained in:
parent
c9674812c3
commit
1eb82c55e7
1 changed files with 4 additions and 2 deletions
|
|
@ -131,7 +131,9 @@ fun StreamsScreen(
|
|||
} else {
|
||||
watchProgressUiState.byVideoId[videoId]
|
||||
}
|
||||
val storedProgressFraction = storedProgress?.progressPercent
|
||||
val storedProgressFraction = storedProgress
|
||||
?.takeIf { it.isResumable }
|
||||
?.progressPercent
|
||||
?.takeIf { it > 0f }
|
||||
?.let { explicitPercent -> (explicitPercent / 100f).coerceIn(0f, 1f) }
|
||||
val effectiveResumeProgressFraction = if (startFromBeginning) {
|
||||
|
|
@ -148,7 +150,7 @@ fun StreamsScreen(
|
|||
if (startFromBeginning) {
|
||||
null
|
||||
} else {
|
||||
(resumePositionMs ?: storedProgress?.lastPositionMs)?.takeIf { it > 0L }
|
||||
(resumePositionMs ?: storedProgress?.takeIf { it.isResumable }?.lastPositionMs)?.takeIf { it > 0L }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue