aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/views/video-views-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/views/video-views-manager.ts')
-rw-r--r--server/lib/views/video-views-manager.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/lib/views/video-views-manager.ts b/server/lib/views/video-views-manager.ts
index e07af1ca9..9382fb482 100644
--- a/server/lib/views/video-views-manager.ts
+++ b/server/lib/views/video-views-manager.ts
@@ -3,6 +3,24 @@ import { MVideo } from '@server/types/models'
3import { VideoViewEvent } from '@shared/models' 3import { VideoViewEvent } from '@shared/models'
4import { VideoViewers, VideoViews } from './shared' 4import { VideoViewers, VideoViews } from './shared'
5 5
6/**
7 * If processing a local view:
8 * - We update viewer information (segments watched, watch time etc)
9 * - We add +1 to video viewers counter if this is a new viewer
10 * - We add +1 to video views counter if this is a new view and if the user watched enough seconds
11 * - We send AP message to notify about this viewer and this view
12 * - We update last video time for the user if authenticated
13 *
14 * If processing a remote view:
15 * - We add +1 to video viewers counter
16 * - We add +1 to video views counter
17 *
18 * A viewer is a someone that watched one or multiple sections of a video
19 * A viewer that watched only a few seconds of a video may not increment the video views counter
20 * Viewers statistics are sent to origin instance using the `WatchAction` ActivityPub object
21 *
22 */
23
6const lTags = loggerTagsFactory('views') 24const lTags = loggerTagsFactory('views')
7 25
8export class VideoViewsManager { 26export class VideoViewsManager {