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,
|
activeEpisodeNumber,
|
||||||
) { mutableStateOf(false) }
|
) { mutableStateOf(false) }
|
||||||
var hasSentCompletionScrobbleForCurrentItem by remember(
|
var hasSentCompletionScrobbleForCurrentItem by remember(
|
||||||
activeSourceUrl,
|
|
||||||
activeVideoId,
|
activeVideoId,
|
||||||
activeSeasonNumber,
|
activeSeasonNumber,
|
||||||
activeEpisodeNumber,
|
activeEpisodeNumber,
|
||||||
|
|
@ -379,7 +378,6 @@ fun PlayerScreen(
|
||||||
val progressPercent = currentPlaybackProgressPercent()
|
val progressPercent = currentPlaybackProgressPercent()
|
||||||
if (progressPercent >= 1f && progressPercent < 80f) {
|
if (progressPercent >= 1f && progressPercent < 80f) {
|
||||||
emitTraktScrobbleStop(progressPercent)
|
emitTraktScrobbleStop(progressPercent)
|
||||||
hasSentCompletionScrobbleForCurrentItem = false
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1195,15 +1193,20 @@ fun PlayerScreen(
|
||||||
pausedOverlayVisible = true
|
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) {
|
if (playbackSnapshot.isEnded) {
|
||||||
hasSentCompletionScrobbleForCurrentItem = false
|
|
||||||
flushWatchProgress()
|
flushWatchProgress()
|
||||||
previousIsPlaying = false
|
previousIsPlaying = false
|
||||||
return@LaunchedEffect
|
return@LaunchedEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previousIsPlaying && !playbackSnapshot.isPlaying) {
|
if (previousIsPlaying && !playbackSnapshot.isPlaying && !playbackSnapshot.isLoading) {
|
||||||
flushWatchProgress()
|
flushWatchProgress()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1211,7 +1214,9 @@ fun PlayerScreen(
|
||||||
emitTraktScrobbleStart()
|
emitTraktScrobbleStart()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!playbackSnapshot.isLoading) {
|
||||||
previousIsPlaying = playbackSnapshot.isPlaying
|
previousIsPlaying = playbackSnapshot.isPlaying
|
||||||
|
}
|
||||||
|
|
||||||
if (!playbackSnapshot.isPlaying) {
|
if (!playbackSnapshot.isPlaying) {
|
||||||
return@LaunchedEffect
|
return@LaunchedEffect
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue