From cc49be3e3547703d00ef7363d664221a39334ca3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 30 Dec 2020 14:29:17 +0100 Subject: Fix views processing hour 0 --- server/lib/redis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 4325598b2..257cce141 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts @@ -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}` } -- cgit v1.2.3