mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +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
|
@ -3,25 +3,6 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
|||
|
||||
export class HistoryCommand extends AbstractCommand {
|
||||
|
||||
watchVideo (options: OverrideCommandOptions & {
|
||||
videoId: number | string
|
||||
currentTime: number
|
||||
}) {
|
||||
const { videoId, currentTime } = options
|
||||
|
||||
const path = '/api/v1/videos/' + videoId + '/watching'
|
||||
const fields = { currentTime }
|
||||
|
||||
return this.putBodyRequest({
|
||||
...options,
|
||||
|
||||
path,
|
||||
fields,
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
}
|
||||
|
||||
list (options: OverrideCommandOptions & {
|
||||
search?: string
|
||||
} = {}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue