diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-24 13:36:47 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-04-15 09:49:35 +0200 |
commit | b211106695bb82f6c32e53306081b5262c3d109d (patch) | |
tree | fa187de1c33b0956665f5362e29af6b0f6d8bb57 /shared/server-commands/server/server.ts | |
parent | 69d48ee30c9d47cddf0c3c047dc99a99dcb6e894 (diff) | |
download | PeerTube-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/server.ts')
-rw-r--r-- | shared/server-commands/server/server.ts | 8 |
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' |
31 | import { CommentsCommand } from '../videos/comments-command' | 32 | import { CommentsCommand } from '../videos/comments-command' |
33 | import { VideoStatsCommand } from '../videos/video-stats-command' | ||
32 | import { ConfigCommand } from './config-command' | 34 | import { ConfigCommand } from './config-command' |
33 | import { ContactFormCommand } from './contact-form-command' | 35 | import { ContactFormCommand } from './contact-form-command' |
34 | import { DebugCommand } from './debug-command' | 36 | import { 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 | } |