aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/views/video-views-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-04-05 15:15:09 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-04-15 09:49:35 +0200
commitdfbcefc20dc64f0814b1f2e8e782a4ea1bd24db2 (patch)
tree887521117856c06e6c814a0eb79d67f85ffe8eff /server/lib/views/video-views-manager.ts
parentd74bb0647c79748860ad39c4b7b1be59504b47b7 (diff)
downloadPeerTube-dfbcefc20dc64f0814b1f2e8e782a4ea1bd24db2.tar.gz
PeerTube-dfbcefc20dc64f0814b1f2e8e782a4ea1bd24db2.tar.zst
PeerTube-dfbcefc20dc64f0814b1f2e8e782a4ea1bd24db2.zip
Improve views/viewers documentation
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 {