Use round for views stats

pull/4903/head
Chocobozzz 2022-04-15 10:47:48 +02:00
parent 3eda9b775a
commit 1222a602a3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class PeerTubePlugin extends Plugin {
})
this.player.one('ended', () => {
const currentTime = Math.floor(this.player.duration())
const currentTime = Math.round(this.player.duration())
lastCurrentTime = currentTime
this.notifyUserIsWatching(currentTime, lastViewEvent)
@ -168,7 +168,7 @@ class PeerTubePlugin extends Plugin {
})
this.videoViewInterval = setInterval(() => {
const currentTime = Math.floor(this.player.currentTime())
const currentTime = Math.round(this.player.currentTime())
// No need to update
if (currentTime === lastCurrentTime) return