]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix views processing hour 0
authorChocobozzz <me@florianbigard.com>
Wed, 30 Dec 2020 13:29:17 +0000 (14:29 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 30 Dec 2020 13:29:17 +0000 (14:29 +0100)
server/lib/redis.ts

index 4325598b2f3df6c2cf35adfcfb1ff3447c08ab9a..257cce1418b6338a25c4b6c65fb43ad97e8006c0 100644 (file)
@@ -215,7 +215,7 @@ class Redis {
   }
 
   private generateVideoViewKey (videoId: number, hour?: number) {
-    if (!hour) hour = new Date().getHours()
+    if (hour === undefined || hour === null) hour = new Date().getHours()
 
     return `video-view-${videoId}-h${hour}`
   }