]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Add url field in caption and use it for thumbnails
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index f4a2b358b4f048e1da746ae44fa9c920509c104c..3a9946bbad3f8ab23348d326e2fe5eb11758b323 100644 (file)
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 465
+const LAST_MIGRATION_VERSION = 480
 
 // ---------------------------------------------------------------------------
 
@@ -22,9 +22,16 @@ const API_VERSION = 'v1'
 const PEERTUBE_VERSION = require(join(root(), 'package.json')).version
 
 const PAGINATION = {
-  COUNT: {
-    DEFAULT: 15,
-    MAX: 100
+  GLOBAL: {
+    COUNT: {
+      DEFAULT: 15,
+      MAX: 100
+    }
+  },
+  OUTBOX: {
+    COUNT: {
+      MAX: 50
+    }
   }
 }
 
@@ -66,7 +73,9 @@ const SORTABLE_COLUMNS = {
 
   PLUGINS: [ 'name', 'createdAt', 'updatedAt' ],
 
-  AVAILABLE_PLUGINS: [ 'npmName', 'popularity' ]
+  AVAILABLE_PLUGINS: [ 'npmName', 'popularity' ],
+
+  VIDEO_REDUNDANCIES: [ 'name' ]
 }
 
 const OAUTH_LIFETIME = {
@@ -110,45 +119,44 @@ const REMOTE_SCHEME = {
   WS: 'wss'
 }
 
-// TODO: remove 'video-file'
-const JOB_ATTEMPTS: { [id in (JobType | 'video-file')]: number } = {
+const JOB_ATTEMPTS: { [id in JobType]: number } = {
   'activitypub-http-broadcast': 5,
   'activitypub-http-unicast': 5,
   'activitypub-http-fetcher': 5,
   'activitypub-follow': 5,
   'video-file-import': 1,
   'video-transcoding': 1,
-  'video-file': 1,
   'video-import': 1,
   'email': 5,
   'videos-views': 1,
-  'activitypub-refresher': 1
+  'activitypub-refresher': 1,
+  'video-redundancy': 1
 }
-const JOB_CONCURRENCY: { [id in (JobType | 'video-file')]: number } = {
+const JOB_CONCURRENCY: { [id in JobType]: number } = {
   'activitypub-http-broadcast': 1,
   'activitypub-http-unicast': 5,
   'activitypub-http-fetcher': 1,
-  'activitypub-follow': 3,
+  'activitypub-follow': 1,
   'video-file-import': 1,
   'video-transcoding': 1,
-  'video-file': 1,
   'video-import': 1,
   'email': 5,
   'videos-views': 1,
-  'activitypub-refresher': 1
+  'activitypub-refresher': 1,
+  'video-redundancy': 1
 }
-const JOB_TTL: { [id in (JobType | 'video-file')]: number } = {
+const JOB_TTL: { [id in JobType]: number } = {
   'activitypub-http-broadcast': 60000 * 10, // 10 minutes
   'activitypub-http-unicast': 60000 * 10, // 10 minutes
   'activitypub-http-fetcher': 60000 * 10, // 10 minutes
   'activitypub-follow': 60000 * 10, // 10 minutes
   'video-file-import': 1000 * 3600, // 1 hour
   'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long
-  'video-file': 1000 * 3600 * 48, // 2 days, transcoding could be long
   'video-import': 1000 * 3600 * 2, //  hours
   'email': 60000 * 10, // 10 minutes
   'videos-views': undefined, // Unlimited
-  'activitypub-refresher': 60000 * 10 // 10 minutes
+  'activitypub-refresher': 60000 * 10, // 10 minutes
+  'video-redundancy': 1000 * 3600 * 3 // 3 hours
 }
 const REPEAT_JOBS: { [ id: string ]: EveryRepeatOptions | CronRepeatOptions } = {
   'videos-views': {
@@ -302,6 +310,8 @@ let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour
 
 const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
   MIN: 10,
+  STANDARD: [24, 25, 30],
+  HD_STANDARD: [50, 60],
   AVERAGE: 30,
   MAX: 60,
   KEEP_ORIGIN_FPS_RESOLUTION_MIN: 720 // We keep the original FPS on high resolutions (720 minimum)
@@ -531,11 +541,13 @@ let STATIC_MAX_AGE = {
 // Videos thumbnail size
 const THUMBNAILS_SIZE = {
   width: 223,
-  height: 122
+  height: 122,
+  minWidth: 150
 }
 const PREVIEWS_SIZE = {
   width: 850,
-  height: 480
+  height: 480,
+  minWidth: 400
 }
 const AVATARS_SIZE = {
   width: 120,