From 6a02dd1c3d250130404cd22e3691f4e681208e15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 10:51:51 +0200 Subject: Fix metric with old webtorrent videos --- client/src/assets/player/shared/metrics/metrics-plugin.ts | 4 +++- client/src/root-helpers/logger.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/assets/player/shared/metrics/metrics-plugin.ts b/client/src/assets/player/shared/metrics/metrics-plugin.ts index 1b2349eba..2844828da 100644 --- a/client/src/assets/player/shared/metrics/metrics-plugin.ts +++ b/client/src/assets/player/shared/metrics/metrics-plugin.ts @@ -64,7 +64,9 @@ class MetricsPlugin extends Plugin { if (!videoFile) return resolution = videoFile.resolution.id - fps = videoFile.fps + fps = videoFile.fps && videoFile.fps !== -1 + ? videoFile.fps + : undefined } const body: PlaybackMetricCreate = { diff --git a/client/src/root-helpers/logger.ts b/client/src/root-helpers/logger.ts index 0dcda525e..0d486c433 100644 --- a/client/src/root-helpers/logger.ts +++ b/client/src/root-helpers/logger.ts @@ -131,7 +131,6 @@ class Logger { private buildStack (err: Error) { return `${err.message}\n${err.stack || ''}` - } } -- cgit v1.2.3