From 7815dc450ea9f8fd63e2234b6215013a132e6229 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 14:23:59 +0200 Subject: [PATCH] Prevent invalid end watch section warnings --- client/e2e/src/utils/mock-smtp.ts | 2 -- client/src/app/+login/login.component.ts | 2 -- .../app/shared/shared-share-modal/video-share.component.ts | 2 -- .../src/assets/player/shared/peertube/peertube-plugin.ts | 6 ++++-- server/lib/views/shared/video-viewer-stats.ts | 7 ++++++- shared/server-commands/server/servers-command.ts | 1 - 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/e2e/src/utils/mock-smtp.ts b/client/e2e/src/utils/mock-smtp.ts index be6f8b259..77691e981 100644 --- a/client/e2e/src/utils/mock-smtp.ts +++ b/client/e2e/src/utils/mock-smtp.ts @@ -24,8 +24,6 @@ class MockSMTPServer { this.maildev.on('new', email => { this.emails.push(email) - - console.log('pushed email', email) }) this.maildev.listen(err => { diff --git a/client/src/app/+login/login.component.ts b/client/src/app/+login/login.component.ts index c03af38f2..ba0d412d6 100644 --- a/client/src/app/+login/login.component.ts +++ b/client/src/app/+login/login.component.ts @@ -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 diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts index 43229c330..1b69aa2d0 100644 --- a/client/src/app/shared/shared-share-modal/video-share.component.ts +++ b/client/src/app/shared/shared-share-modal/video-share.component.ts @@ -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() diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts index cf96b33ba..af2147749 100644 --- a/client/src/assets/player/shared/peertube/peertube-plugin.ts +++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts @@ -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' }) diff --git a/server/lib/views/shared/video-viewer-stats.ts b/server/lib/views/shared/video-viewer-stats.ts index 39e34fb90..ebd963e59 100644 --- a/server/lib/views/shared/video-viewer-stats.ts +++ b/server/lib/views/shared/video-viewer-stats.ts @@ -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 } diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts index f174a2aa0..19645cb93 100644 --- a/shared/server-commands/server/servers-command.ts +++ b/shared/server-commands/server/servers-command.ts @@ -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() -- 2.41.0