]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/initializers/constants.js
Move the count of results for the pagination in constants module
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.js
CommitLineData
9f10b292
C
1'use strict'
2
3// API version of our pod
f0f5567b 4const API_VERSION = 'v1'
9f10b292
C
5
6// Score a pod has when we create it as a friend
f0f5567b 7let FRIEND_BASE_SCORE = 100
9f10b292
C
8
9// Time to wait between requests to the friends
f0f5567b 10let INTERVAL = 60000
9f10b292 11
3fe81fa7
C
12// Number of results by default for the pagination
13const PAGINATION_COUNT_DEFAULT = 15
14
9f10b292 15// Number of points we add/remove from a friend after a successful/bad request
f0f5567b 16const PODS_SCORE = {
9f10b292
C
17 MALUS: -10,
18 BONUS: 10
19}
20
21// Number of retries we make for the make retry requests (to friends...)
f0f5567b 22let REQUEST_RETRIES = 10
9f10b292 23
cbe2f7c3
C
24// Videos thumbnail size
25const THUMBNAILS_SIZE = '200x110'
26
27// Path for access to thumbnails with express router
28const THUMBNAILS_STATIC_PATH = '/static/thumbnails'
29
9f10b292
C
30// Special constants for a test instance
31if (isTestInstance() === true) {
32 FRIEND_BASE_SCORE = 20
33 INTERVAL = 10000
34 REQUEST_RETRIES = 2
35}
36
37// ---------------------------------------------------------------------------
38
39module.exports = {
40 API_VERSION: API_VERSION,
41 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,
42 INTERVAL: INTERVAL,
3fe81fa7 43 PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT,
9f10b292 44 PODS_SCORE: PODS_SCORE,
cbe2f7c3
C
45 REQUEST_RETRIES: REQUEST_RETRIES,
46 THUMBNAILS_SIZE: THUMBNAILS_SIZE,
47 THUMBNAILS_STATIC_PATH: THUMBNAILS_STATIC_PATH
9f10b292
C
48}
49
50// ---------------------------------------------------------------------------
51
52function isTestInstance () {
53 return (process.env.NODE_ENV === 'test')
54}