From c655c9ef6f7ddb47a153adc04d5c10c6de3d5ed7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Nov 2020 16:43:43 +0100 Subject: Update ffmpeg static version for tests --- server/lib/activitypub/process/process-view.ts | 6 ++++-- server/lib/live-manager.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/process/process-view.ts b/server/lib/activitypub/process/process-view.ts index efceb21a2..84697673b 100644 --- a/server/lib/activitypub/process/process-view.ts +++ b/server/lib/activitypub/process/process-view.ts @@ -31,6 +31,10 @@ async function processCreateView (activity: ActivityView | ActivityCreate, byAct } const { video } = await getOrCreateVideoAndAccountAndChannel(options) + if (!video.isLive) { + await Redis.Instance.addVideoView(video.id) + } + if (video.isOwned()) { // Our live manager will increment the counter and send the view to followers if (video.isLive) { @@ -38,8 +42,6 @@ async function processCreateView (activity: ActivityView | ActivityCreate, byAct return } - await Redis.Instance.addVideoView(video.id) - // Forward the view but don't resend the activity to the sender const exceptions = [ byActor ] await forwardVideoRelatedActivity(activity, undefined, exceptions, video) diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index 4a1081a4f..e85998686 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts @@ -4,6 +4,7 @@ import * as chokidar from 'chokidar' import { FfmpegCommand } from 'fluent-ffmpeg' import { ensureDir, stat } from 'fs-extra' import { basename } from 'path' +import { isTestInstance } from '@server/helpers/core-utils' import { computeResolutionsToTranscode, getVideoFileFPS, @@ -451,7 +452,7 @@ class LiveManager { private async updateLiveViews () { if (!this.isRunning()) return - logger.info('Updating live video views.') + if (!isTestInstance()) logger.info('Updating live video views.') for (const videoId of this.watchersPerVideo.keys()) { const notBefore = new Date().getTime() - VIEW_LIFETIME.LIVE -- cgit v1.2.3