mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
fix: only add videos to watch history if playback started
This commit is contained in:
parent
1a78dd0475
commit
b428b9073a
@ -774,11 +774,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
fetchSponsorBlockSegments()
|
||||
|
||||
initializeChapters()
|
||||
|
||||
// add the video to the watch history
|
||||
if (PlayerHelper.watchHistoryEnabled) {
|
||||
DatabaseHelper.addToWatchHistory(videoId, streams)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -888,6 +883,13 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
BackgroundHelper.stopBackgroundPlay(requireContext())
|
||||
}
|
||||
|
||||
// add the video to the watch history when starting to play the video
|
||||
if (isPlaying && PlayerHelper.watchHistoryEnabled) {
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
DatabaseHelper.addToWatchHistory(videoId, streams)
|
||||
}
|
||||
}
|
||||
|
||||
if (isPlaying && PlayerHelper.sponsorBlockEnabled) {
|
||||
handler.postDelayed(
|
||||
this@PlayerFragment::checkForSegments,
|
||||
|
Loading…
Reference in New Issue
Block a user