]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Prevent invalid end watch section warnings
authorChocobozzz <me@florianbigard.com>
Wed, 10 May 2023 12:23:59 +0000 (14:23 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 10 May 2023 12:23:59 +0000 (14:23 +0200)
client/e2e/src/utils/mock-smtp.ts
client/src/app/+login/login.component.ts
client/src/app/shared/shared-share-modal/video-share.component.ts
client/src/assets/player/shared/peertube/peertube-plugin.ts
server/lib/views/shared/video-viewer-stats.ts
shared/server-commands/server/servers-command.ts

index be6f8b2598f2c6e1dcf220375f62d79324972860..77691e9812d1eea9d0eb162d065c36a73b206b4e 100644 (file)
@@ -24,8 +24,6 @@ class MockSMTPServer {
 
       this.maildev.on('new', email => {
         this.emails.push(email)
-
-        console.log('pushed email', email)
       })
 
       this.maildev.listen(err => {
index c03af38f284956c9dbdcfe2458ed08e1a764ea8d..ba0d412d61824e3046fb240b5ca357ce1b61375f 100644 (file)
@@ -197,8 +197,6 @@ The link will expire within 1 hour.`
   }
 
   private handleError (err: any) {
-    console.log(err)
-
     if (this.authService.isOTPMissingError(err)) {
       this.otpStep = true
 
index 43229c330a66b08dbcbf546b0e2f44f71b4a28c7..1b69aa2d05e5ad6e56b51281506e86d51738697b 100644 (file)
@@ -203,8 +203,6 @@ export class VideoShareComponent {
   // ---------------------------------------------------------------------------
 
   async onUpdate () {
-    console.log('on update')
-
     if (this.playlist) {
       this.playlistUrl = await this.getPlaylistUrl()
       this.playlistEmbedUrl = await this.getPlaylistEmbedUrl()
index cf96b33bad1dcb0e2d68fe39204deb71c59b048c..af21477491444b5192183a1b528d43f7ef89317b 100644 (file)
@@ -180,8 +180,10 @@ class PeerTubePlugin extends Plugin {
     })
 
     this.player.on('seeked', () => {
-      // Don't take into account small seek events
-      if (Math.abs(this.player.currentTime() - lastCurrentTime) < 3) return
+      const diff = Math.floor(this.player.currentTime()) - lastCurrentTime
+
+      // Don't take into account small forwards
+      if (diff > 0 && diff < 3) return
 
       lastViewEvent = 'seek'
     })
index 39e34fb9095d9c303242beb93e87c3dcb3bc0b28..ebd963e598f57e90a4939f672d715a15d2693d54 100644 (file)
@@ -106,7 +106,12 @@ export class VideoViewerStats {
       const lastSection = stats.watchSections[stats.watchSections.length - 1]
 
       if (lastSection.start > currentTime) {
-        logger.warn('Invalid end watch section %d. Last start record was at %d.', currentTime, lastSection.start)
+        logger.debug('Invalid end watch section %d. Last start record was at %d. Starting a new section.', currentTime, lastSection.start)
+
+        stats.watchSections.push({
+          start: currentTime,
+          end: currentTime
+        })
       } else {
         lastSection.end = currentTime
       }
index f174a2aa02c30146d00e5eee98a4f21968c52371..19645cb93a1eae15e82389a9ff4a014d4b351024 100644 (file)
@@ -44,7 +44,6 @@ export class ServersCommand extends AbstractCommand {
 
       await copy(origin, join('artifacts', destname))
     }
-    console.log(this.server.parallel)
 
     if (this.server.parallel) {
       const promise = saveGithubLogsIfNeeded()