mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix watch positions
This commit is contained in:
parent
5518de4176
commit
47fccb760a
@ -520,13 +520,17 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
|
|
||||||
// save the watch position if video isn't finished and option enabled
|
// save the watch position if video isn't finished and option enabled
|
||||||
private fun saveWatchPosition() {
|
private fun saveWatchPosition() {
|
||||||
if (PlayerHelper.watchPositionsEnabled && exoPlayer.currentPosition != exoPlayer.duration) {
|
if (!PlayerHelper.watchPositionsEnabled) return
|
||||||
|
if (exoPlayer.currentPosition != exoPlayer.duration) {
|
||||||
|
val watchPosition = WatchPosition(videoId!!, exoPlayer.currentPosition)
|
||||||
query {
|
query {
|
||||||
Database.watchPositionDao().insertAll(WatchPosition(videoId!!, exoPlayer.currentPosition))
|
Database.watchPositionDao().insertAll(watchPosition)
|
||||||
}
|
}
|
||||||
} else if (PlayerHelper.watchPositionsEnabled) {
|
} else if (PlayerHelper.watchPositionsEnabled) {
|
||||||
// delete watch position if video has ended
|
// delete watch position if video has ended
|
||||||
Database.watchPositionDao().deleteById(videoId!!)
|
query {
|
||||||
|
Database.watchPositionDao().deleteById(videoId!!)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user