mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
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
This commit is contained in:
parent
69d48ee30c
commit
b211106695
108 changed files with 2834 additions and 655 deletions
|
@ -25,10 +25,12 @@ import {
|
|||
PlaylistsCommand,
|
||||
ServicesCommand,
|
||||
StreamingPlaylistsCommand,
|
||||
VideosCommand,
|
||||
VideoStudioCommand,
|
||||
VideosCommand
|
||||
ViewsCommand
|
||||
} from '../videos'
|
||||
import { CommentsCommand } from '../videos/comments-command'
|
||||
import { VideoStatsCommand } from '../videos/video-stats-command'
|
||||
import { ConfigCommand } from './config-command'
|
||||
import { ContactFormCommand } from './contact-form-command'
|
||||
import { DebugCommand } from './debug-command'
|
||||
|
@ -127,6 +129,8 @@ export class PeerTubeServer {
|
|||
objectStorage?: ObjectStorageCommand
|
||||
videoStudio?: VideoStudioCommand
|
||||
videos?: VideosCommand
|
||||
videoStats?: VideoStatsCommand
|
||||
views?: ViewsCommand
|
||||
|
||||
constructor (options: { serverNumber: number } | { url: string }) {
|
||||
if ((options as any).url) {
|
||||
|
@ -397,5 +401,7 @@ export class PeerTubeServer {
|
|||
this.videos = new VideosCommand(this)
|
||||
this.objectStorage = new ObjectStorageCommand(this)
|
||||
this.videoStudio = new VideoStudioCommand(this)
|
||||
this.videoStats = new VideoStatsCommand(this)
|
||||
this.views = new ViewsCommand(this)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue