// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 10
+const LAST_MIGRATION_VERSION = 30
// ---------------------------------------------------------------------------
// Sortable columns per schema
const SORTABLE_COLUMNS = {
- USERS: [ 'id', '-id', 'username', '-username', 'createdAt', '-createdAt' ],
- VIDEO_ABUSES: [ 'id', '-id', 'createdAt', '-createdAt' ],
- VIDEOS: [ 'name', '-name', 'duration', '-duration', 'createdAt', '-createdAt' ]
+ USERS: [ 'id', 'username', 'createdAt' ],
+ VIDEO_ABUSES: [ 'id', 'createdAt' ],
+ VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ]
}
const OAUTH_LIFETIME = {
},
ADMIN: {
EMAIL: config.get('admin.email')
+ },
+ SIGNUP: {
+ ENABLED: config.get('signup.enabled')
}
}
CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
EXTNAME: [ '.mp4', '.ogv', '.webm' ],
INFO_HASH: { min: 40, max: 40 }, // Length, infohash is 20 bytes length but we represent it in hexa so 20 * 2
DURATION: { min: 1, max: 7200 }, // Number
- TAGS: { min: 1, max: 3 }, // Number of total tags
+ TAGS: { min: 0, max: 3 }, // Number of total tags
TAG: { min: 2, max: 10 }, // Length
THUMBNAIL: { min: 2, max: 30 },
- THUMBNAIL_DATA: { min: 0, max: 20000 } // Bytes
+ THUMBNAIL_DATA: { min: 0, max: 20000 }, // Bytes
+ VIEWS: { min: 0 },
+ LIKES: { min: 0 },
+ DISLIKES: { min: 0 }
+ },
+ VIDEO_EVENTS: {
+ COUNT: { min: 0 }
}
}
+const VIDEO_RATE_TYPES = {
+ LIKE: 'like',
+ DISLIKE: 'dislike'
+}
+
+const VIDEO_CATEGORIES = {
+ 1: 'Music',
+ 2: 'Films',
+ 3: 'Vehicles',
+ 4: 'Art',
+ 5: 'Sports',
+ 6: 'Travels',
+ 7: 'Gaming',
+ 8: 'People',
+ 9: 'Comedy',
+ 10: 'Entertainment',
+ 11: 'News',
+ 12: 'Howto',
+ 13: 'Education',
+ 14: 'Activism',
+ 15: 'Science & Technology',
+ 16: 'Animals',
+ 17: 'Kids',
+ 18: 'Food'
+}
+
// ---------------------------------------------------------------------------
// Score a pod has when we create it as a friend
// How many requests we send to a pod per interval
const REQUESTS_LIMIT_PER_POD = 5
+const REQUESTS_VIDEO_QADU_LIMIT_PODS = 10
+// The QADU requests are not big
+const REQUESTS_VIDEO_QADU_LIMIT_PER_POD = 50
+
+const REQUESTS_VIDEO_EVENT_LIMIT_PODS = 10
+// The EVENTS requests are not big
+const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50
+
// Number of requests to retry for replay requests module
const RETRY_REQUESTS = 5
const REQUEST_ENDPOINTS = {
VIDEOS: 'videos'
}
+
const REQUEST_ENDPOINT_ACTIONS = {}
REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
ADD: 'add',
REPORT_ABUSE: 'report-abuse'
}
+const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu'
+const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events'
+
+const REQUEST_VIDEO_QADU_TYPES = {
+ LIKES: 'likes',
+ DISLIKES: 'dislikes',
+ VIEWS: 'views'
+}
+
+const REQUEST_VIDEO_EVENT_TYPES = {
+ LIKES: 'likes',
+ DISLIKES: 'dislikes',
+ VIEWS: 'views'
+}
+
const REMOTE_SCHEME = {
HTTP: 'https',
WS: 'wss'
REMOTE_SCHEME,
REQUEST_ENDPOINT_ACTIONS,
REQUEST_ENDPOINTS,
+ REQUEST_VIDEO_EVENT_ENDPOINT,
+ REQUEST_VIDEO_EVENT_TYPES,
+ REQUEST_VIDEO_QADU_ENDPOINT,
+ REQUEST_VIDEO_QADU_TYPES,
REQUESTS_IN_PARALLEL,
REQUESTS_INTERVAL,
REQUESTS_LIMIT_PER_POD,
REQUESTS_LIMIT_PODS,
+ REQUESTS_VIDEO_EVENT_LIMIT_PER_POD,
+ REQUESTS_VIDEO_EVENT_LIMIT_PODS,
+ REQUESTS_VIDEO_QADU_LIMIT_PER_POD,
+ REQUESTS_VIDEO_QADU_LIMIT_PODS,
RETRY_REQUESTS,
SEARCHABLE_COLUMNS,
SIGNATURE_ALGORITHM,
STATIC_MAX_AGE,
STATIC_PATHS,
THUMBNAILS_SIZE,
- USER_ROLES
+ USER_ROLES,
+ VIDEO_CATEGORIES,
+ VIDEO_RATE_TYPES
}
// ---------------------------------------------------------------------------