diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/process/process-view.ts | 6 | ||||
-rw-r--r-- | server/lib/live-manager.ts | 3 |
2 files changed, 6 insertions, 3 deletions
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 | |||
31 | } | 31 | } |
32 | const { video } = await getOrCreateVideoAndAccountAndChannel(options) | 32 | const { video } = await getOrCreateVideoAndAccountAndChannel(options) |
33 | 33 | ||
34 | if (!video.isLive) { | ||
35 | await Redis.Instance.addVideoView(video.id) | ||
36 | } | ||
37 | |||
34 | if (video.isOwned()) { | 38 | if (video.isOwned()) { |
35 | // Our live manager will increment the counter and send the view to followers | 39 | // Our live manager will increment the counter and send the view to followers |
36 | if (video.isLive) { | 40 | if (video.isLive) { |
@@ -38,8 +42,6 @@ async function processCreateView (activity: ActivityView | ActivityCreate, byAct | |||
38 | return | 42 | return |
39 | } | 43 | } |
40 | 44 | ||
41 | await Redis.Instance.addVideoView(video.id) | ||
42 | |||
43 | // Forward the view but don't resend the activity to the sender | 45 | // Forward the view but don't resend the activity to the sender |
44 | const exceptions = [ byActor ] | 46 | const exceptions = [ byActor ] |
45 | await forwardVideoRelatedActivity(activity, undefined, exceptions, video) | 47 | 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' | |||
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { ensureDir, stat } from 'fs-extra' | 5 | import { ensureDir, stat } from 'fs-extra' |
6 | import { basename } from 'path' | 6 | import { basename } from 'path' |
7 | import { isTestInstance } from '@server/helpers/core-utils' | ||
7 | import { | 8 | import { |
8 | computeResolutionsToTranscode, | 9 | computeResolutionsToTranscode, |
9 | getVideoFileFPS, | 10 | getVideoFileFPS, |
@@ -451,7 +452,7 @@ class LiveManager { | |||
451 | private async updateLiveViews () { | 452 | private async updateLiveViews () { |
452 | if (!this.isRunning()) return | 453 | if (!this.isRunning()) return |
453 | 454 | ||
454 | logger.info('Updating live video views.') | 455 | if (!isTestInstance()) logger.info('Updating live video views.') |
455 | 456 | ||
456 | for (const videoId of this.watchersPerVideo.keys()) { | 457 | for (const videoId of this.watchersPerVideo.keys()) { |
457 | const notBefore = new Date().getTime() - VIEW_LIFETIME.LIVE | 458 | const notBefore = new Date().getTime() - VIEW_LIFETIME.LIVE |