From 38b8fa895250bd72cfe8ab5140815f699f05f61a Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 27 Dec 2022 19:32:08 +0100 Subject: [PATCH] Fix that watch positions don't work for the queue --- .../com/github/libretube/ui/fragments/PlayerFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index f1aeffe05..e206fa963 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -877,8 +877,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { playbackState == Player.STATE_ENDED ) - // save the watch position every time the state changes - saveWatchPosition() + // save the watch position to the database + // only called when the position is unequal to 0, otherwise it would become reset + // before the player can seek to the saved position from videos of the queue + if (exoPlayer.currentPosition != 0L) saveWatchPosition() // check if video has ended, next video is available and autoplay is enabled. @Suppress("DEPRECATION")