1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +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:
Chocobozzz 2022-03-24 13:36:47 +01:00 committed by Chocobozzz
parent 69d48ee30c
commit b211106695
108 changed files with 2834 additions and 655 deletions

View file

@ -57,10 +57,19 @@ function setValidAttributedTo (obj: any) {
return true
}
function isActivityPubVideoDurationValid (value: string) {
// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration
return exists(value) &&
typeof value === 'string' &&
value.startsWith('PT') &&
value.endsWith('S')
}
export {
isUrlValid,
isActivityPubUrlValid,
isBaseActivityValid,
setValidAttributedTo,
isObjectValid
isObjectValid,
isActivityPubVideoDurationValid
}