]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/initializers/constants.js
3 // API version of our pod
4 const API_VERSION
= 'v1'
6 // Score a pod has when we create it as a friend
7 let FRIEND_BASE_SCORE
= 100
9 // Time to wait between requests to the friends
12 // Number of results by default for the pagination
13 const PAGINATION_COUNT_DEFAULT
= 15
15 // Number of points we add/remove from a friend after a successful/bad request
21 // Number of retries we make for the make retry requests (to friends...)
22 let REQUEST_RETRIES
= 10
24 // Videos thumbnail size
25 const THUMBNAILS_SIZE
= '200x110'
27 // Path for access to thumbnails with express router
28 const THUMBNAILS_STATIC_PATH
= '/static/thumbnails'
30 // Special constants for a test instance
31 if (isTestInstance() === true) {
32 FRIEND_BASE_SCORE
= 20
37 // ---------------------------------------------------------------------------
40 API_VERSION: API_VERSION
,
41 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE
,
43 PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT
,
44 PODS_SCORE: PODS_SCORE
,
45 REQUEST_RETRIES: REQUEST_RETRIES
,
46 THUMBNAILS_SIZE: THUMBNAILS_SIZE
,
47 THUMBNAILS_STATIC_PATH: THUMBNAILS_STATIC_PATH
50 // ---------------------------------------------------------------------------
52 function isTestInstance () {
53 return (process
.env
.NODE_ENV
=== 'test')