]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/redis.ts
emails: remove hardcoded PeerTube names
[github/Chocobozzz/PeerTube.git] / server / lib / redis.ts
index a075eee2d900e9765f96d04578e2a167ecb90db4..4325598b2f3df6c2cf35adfcfb1ff3447c08ab9a 100644 (file)
@@ -7,7 +7,7 @@ import {
   USER_EMAIL_VERIFY_LIFETIME,
   USER_PASSWORD_RESET_LIFETIME,
   USER_PASSWORD_CREATE_LIFETIME,
-  VIDEO_VIEW_LIFETIME,
+  VIEW_LIFETIME,
   WEBSERVER,
   TRACKER_RATE_LIMITS
 } from '../initializers/constants'
@@ -118,8 +118,12 @@ class Redis {
 
   /* ************ Views per IP ************ */
 
-  setIPVideoView (ip: string, videoUUID: string) {
-    return this.setValue(this.generateViewKey(ip, videoUUID), '1', VIDEO_VIEW_LIFETIME)
+  setIPVideoView (ip: string, videoUUID: string, isLive: boolean) {
+    const lifetime = isLive
+      ? VIEW_LIFETIME.LIVE
+      : VIEW_LIFETIME.VIDEO
+
+    return this.setValue(this.generateViewKey(ip, videoUUID), '1', lifetime)
   }
 
   async doesVideoIPViewExist (ip: string, videoUUID: string) {