1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Do not take into account empty view sections

This commit is contained in:
Chocobozzz 2024-04-03 14:25:21 +02:00
parent faabe996ba
commit 9b70c8e7e8
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 26 additions and 14 deletions

View file

@ -160,7 +160,7 @@ export class VideoViewerStats {
const statsModel = await this.saveViewerStats(video, stats, t)
if (video.remote) {
if (statsModel && video.remote) {
await sendCreateWatchAction(statsModel, t)
}
})
@ -178,6 +178,8 @@ export class VideoViewerStats {
}
private async saveViewerStats (video: MVideo, stats: LocalViewerStats, transaction: Transaction) {
if (stats.watchTime === 0) return
const statsModel = new LocalVideoViewerModel({
startDate: new Date(stats.firstUpdated),
endDate: new Date(stats.lastUpdated),