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:
parent
faabe996ba
commit
9b70c8e7e8
4 changed files with 26 additions and 14 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue