mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +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
|
@ -1,6 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
|
||||
import {
|
||||
cleanupTests,
|
||||
createMultipleServers,
|
||||
|
@ -10,7 +11,6 @@ import {
|
|||
setAccessTokensToServers,
|
||||
setDefaultVideoChannel
|
||||
} from '@shared/server-commands'
|
||||
import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
|
||||
|
||||
describe('Test plugin action hooks', function () {
|
||||
let servers: PeerTubeServer[]
|
||||
|
@ -61,7 +61,7 @@ describe('Test plugin action hooks', function () {
|
|||
})
|
||||
|
||||
it('Should run action:api.video.viewed', async function () {
|
||||
await servers[0].videos.view({ id: videoUUID })
|
||||
await servers[0].views.simulateView({ id: videoUUID })
|
||||
|
||||
await checkHook('action:api.video.viewed')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue