aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-23 16:39:51 +0100
committerChocobozzz <me@florianbigard.com>2018-02-23 16:44:37 +0100
commitb5c0e95544cec5a33cee3df41c1607d2a0cd5403 (patch)
tree38a5db1faed107f7b75583c32125152812594821 /server/initializers
parente3bb78a2134a5e5755b6dbd8987894572ca31269 (diff)
downloadPeerTube-b5c0e95544cec5a33cee3df41c1607d2a0cd5403.tar.gz
PeerTube-b5c0e95544cec5a33cee3df41c1607d2a0cd5403.tar.zst
PeerTube-b5c0e95544cec5a33cee3df41c1607d2a0cd5403.zip
Avoids easy cheating on vidoe views
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 328a3e70a..2dc73770d 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -231,6 +231,8 @@ const CONSTRAINTS_FIELDS = {
231 } 231 }
232} 232}
233 233
234let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour
235
234const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = { 236const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = {
235 LIKE: 'like', 237 LIKE: 'like',
236 DISLIKE: 'dislike' 238 DISLIKE: 'dislike'
@@ -400,6 +402,7 @@ if (isTestInstance() === true) {
400 ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds 402 ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
401 CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB 403 CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB
402 SCHEDULER_INTERVAL = 10000 404 SCHEDULER_INTERVAL = 10000
405 VIDEO_VIEW_LIFETIME = 1000 // 1 second
403} 406}
404 407
405updateWebserverConfig() 408updateWebserverConfig()
@@ -442,7 +445,8 @@ export {
442 USER_PASSWORD_RESET_LIFETIME, 445 USER_PASSWORD_RESET_LIFETIME,
443 IMAGE_MIMETYPE_EXT, 446 IMAGE_MIMETYPE_EXT,
444 SCHEDULER_INTERVAL, 447 SCHEDULER_INTERVAL,
445 JOB_COMPLETED_LIFETIME 448 JOB_COMPLETED_LIFETIME,
449 VIDEO_VIEW_LIFETIME
446} 450}
447 451
448// --------------------------------------------------------------------------- 452// ---------------------------------------------------------------------------