mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
fix: videos played with background player not added to watch history
This commit is contained in:
parent
e6df9c7038
commit
62ff36b77c
@ -275,6 +275,13 @@ class OnlinePlayerService : LifecycleService() {
|
||||
Player.STATE_BUFFERING -> {}
|
||||
Player.STATE_READY -> {
|
||||
isTransitioning = false
|
||||
|
||||
// save video to watch history when the video starts playing or is being resumed
|
||||
// waiting for the player to be ready since the video can't be claimed to be watched
|
||||
// while it did not yet start actually, but did buffer only so far
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
streams?.let { DatabaseHelper.addToWatchHistory(videoId, it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user