only updateWatch status while video is playing

This should circumvent edge cases where videos are marked as watch when they failed to play back.

Fixes #660

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
Toni Förster 2024-08-20 22:10:35 +02:00
parent af75afa912
commit 522aecfbc1
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7
2 changed files with 1 additions and 3 deletions

View File

@ -47,7 +47,7 @@ extension PlayerModel {
} }
func updateWatch(finished: Bool = false, time: CMTime? = nil) { func updateWatch(finished: Bool = false, time: CMTime? = nil) {
guard let currentVideo, saveHistory else { return } guard let currentVideo, saveHistory, isPlaying else { return }
let id = currentVideo.videoID let id = currentVideo.videoID
let time = time ?? backend.currentTime let time = time ?? backend.currentTime

View File

@ -464,8 +464,6 @@ final class MPVBackend: PlayerBackend {
timeObserverThrottle.execute { timeObserverThrottle.execute {
self.model.updateWatch(time: self.currentTime) self.model.updateWatch(time: self.currentTime)
} }
self.model.updateTime(self.currentTime!)
} }
private func stopClientUpdates() { private func stopClientUpdates() {