aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-24 13:36:47 +0100
committerChocobozzz <chocobozzz@cpy.re>2022-04-15 09:49:35 +0200
commitb211106695bb82f6c32e53306081b5262c3d109d (patch)
treefa187de1c33b0956665f5362e29af6b0f6d8bb57 /shared/server-commands/server
parent69d48ee30c9d47cddf0c3c047dc99a99dcb6e894 (diff)
downloadPeerTube-b211106695bb82f6c32e53306081b5262c3d109d.tar.gz
PeerTube-b211106695bb82f6c32e53306081b5262c3d109d.tar.zst
PeerTube-b211106695bb82f6c32e53306081b5262c3d109d.zip
Support video views/viewers stats in server
* Add "currentTime" and "event" body params to view endpoint * Merge watching and view endpoints * Introduce WatchAction AP activity * Add tables to store viewer information of local videos * Add endpoints to fetch video views/viewers stats of local videos * Refactor views/viewers handlers * Support "views" and "viewers" counters for both VOD and live videos
Diffstat (limited to 'shared/server-commands/server')
-rw-r--r--shared/server-commands/server/server.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index 2bf31b5a4..0ad818a11 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -25,10 +25,12 @@ import {
25 PlaylistsCommand, 25 PlaylistsCommand,
26 ServicesCommand, 26 ServicesCommand,
27 StreamingPlaylistsCommand, 27 StreamingPlaylistsCommand,
28 VideosCommand,
28 VideoStudioCommand, 29 VideoStudioCommand,
29 VideosCommand 30 ViewsCommand
30} from '../videos' 31} from '../videos'
31import { CommentsCommand } from '../videos/comments-command' 32import { CommentsCommand } from '../videos/comments-command'
33import { VideoStatsCommand } from '../videos/video-stats-command'
32import { ConfigCommand } from './config-command' 34import { ConfigCommand } from './config-command'
33import { ContactFormCommand } from './contact-form-command' 35import { ContactFormCommand } from './contact-form-command'
34import { DebugCommand } from './debug-command' 36import { DebugCommand } from './debug-command'
@@ -127,6 +129,8 @@ export class PeerTubeServer {
127 objectStorage?: ObjectStorageCommand 129 objectStorage?: ObjectStorageCommand
128 videoStudio?: VideoStudioCommand 130 videoStudio?: VideoStudioCommand
129 videos?: VideosCommand 131 videos?: VideosCommand
132 videoStats?: VideoStatsCommand
133 views?: ViewsCommand
130 134
131 constructor (options: { serverNumber: number } | { url: string }) { 135 constructor (options: { serverNumber: number } | { url: string }) {
132 if ((options as any).url) { 136 if ((options as any).url) {
@@ -397,5 +401,7 @@ export class PeerTubeServer {
397 this.videos = new VideosCommand(this) 401 this.videos = new VideosCommand(this)
398 this.objectStorage = new ObjectStorageCommand(this) 402 this.objectStorage = new ObjectStorageCommand(this)
399 this.videoStudio = new VideoStudioCommand(this) 403 this.videoStudio = new VideoStudioCommand(this)
404 this.videoStats = new VideoStatsCommand(this)
405 this.views = new ViewsCommand(this)
400 } 406 }
401} 407}