mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
fix: improve trakt scrobble handling
This commit is contained in:
parent
4f62be91b8
commit
1523177ffa
1 changed files with 11 additions and 6 deletions
|
|
@ -223,7 +223,6 @@ fun PlayerScreen(
|
|||
activeEpisodeNumber,
|
||||
) { mutableStateOf(false) }
|
||||
var hasSentCompletionScrobbleForCurrentItem by remember(
|
||||
activeSourceUrl,
|
||||
activeVideoId,
|
||||
activeSeasonNumber,
|
||||
activeEpisodeNumber,
|
||||
|
|
@ -379,7 +378,6 @@ fun PlayerScreen(
|
|||
val progressPercent = currentPlaybackProgressPercent()
|
||||
if (progressPercent >= 1f && progressPercent < 80f) {
|
||||
emitTraktScrobbleStop(progressPercent)
|
||||
hasSentCompletionScrobbleForCurrentItem = false
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1195,15 +1193,20 @@ fun PlayerScreen(
|
|||
pausedOverlayVisible = true
|
||||
}
|
||||
|
||||
LaunchedEffect(playbackSnapshot.positionMs, playbackSnapshot.isPlaying, playbackSnapshot.isEnded, playbackSnapshot.durationMs) {
|
||||
LaunchedEffect(
|
||||
playbackSnapshot.positionMs,
|
||||
playbackSnapshot.isPlaying,
|
||||
playbackSnapshot.isLoading,
|
||||
playbackSnapshot.isEnded,
|
||||
playbackSnapshot.durationMs,
|
||||
) {
|
||||
if (playbackSnapshot.isEnded) {
|
||||
hasSentCompletionScrobbleForCurrentItem = false
|
||||
flushWatchProgress()
|
||||
previousIsPlaying = false
|
||||
return@LaunchedEffect
|
||||
}
|
||||
|
||||
if (previousIsPlaying && !playbackSnapshot.isPlaying) {
|
||||
if (previousIsPlaying && !playbackSnapshot.isPlaying && !playbackSnapshot.isLoading) {
|
||||
flushWatchProgress()
|
||||
}
|
||||
|
||||
|
|
@ -1211,7 +1214,9 @@ fun PlayerScreen(
|
|||
emitTraktScrobbleStart()
|
||||
}
|
||||
|
||||
previousIsPlaying = playbackSnapshot.isPlaying
|
||||
if (!playbackSnapshot.isLoading) {
|
||||
previousIsPlaying = playbackSnapshot.isPlaying
|
||||
}
|
||||
|
||||
if (!playbackSnapshot.isPlaying) {
|
||||
return@LaunchedEffect
|
||||
|
|
|
|||
Loading…
Reference in a new issue