]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Try to fix ARM docker builds
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index c899812a6c755f7fc5943168934f7feb9f53fc0c..9b972b87e137be7c8e6ebfd65350bed4708e95fa 100644 (file)
@@ -14,7 +14,7 @@ import {
   VideoTranscodingFPS
 } from '../../shared/models'
 import { ActivityPubActorType } from '../../shared/models/activitypub'
-import { FollowState } from '../../shared/models/actors'
+import { ActorImageType, FollowState } from '../../shared/models/actors'
 import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
 import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
 import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
@@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 675
+const LAST_MIGRATION_VERSION = 685
 
 // ---------------------------------------------------------------------------
 
@@ -215,7 +215,7 @@ const REQUEST_TIMEOUTS = {
 }
 
 const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
-const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
+const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9)
 
 const SCHEDULER_INTERVALS_MS = {
   ACTOR_FOLLOW_SCORES: 60000 * 60, // 1 hour
@@ -265,7 +265,7 @@ const CONSTRAINTS_FIELDS = {
     CAPTION_FILE: {
       EXTNAME: [ '.vtt', '.srt' ],
       FILE_SIZE: {
-        max: 4 * 1024 * 1024 // 4MB
+        max: 20 * 1024 * 1024 // 20MB
       }
     }
   },
@@ -441,7 +441,9 @@ const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = {
   [VideoImportState.FAILED]: 'Failed',
   [VideoImportState.PENDING]: 'Pending',
   [VideoImportState.SUCCESS]: 'Success',
-  [VideoImportState.REJECTED]: 'Rejected'
+  [VideoImportState.REJECTED]: 'Rejected',
+  [VideoImportState.CANCELLED]: 'Cancelled',
+  [VideoImportState.PROCESSING]: 'Processing'
 }
 
 const ABUSE_STATES: { [ id in AbuseState ]: string } = {
@@ -631,15 +633,23 @@ const PREVIEWS_SIZE = {
   height: 480,
   minWidth: 400
 }
-const ACTOR_IMAGES_SIZE = {
-  AVATARS: {
-    width: 120,
-    height: 120
-  },
-  BANNERS: {
-    width: 1920,
-    height: 317 // 6/1 ratio
-  }
+const ACTOR_IMAGES_SIZE: { [key in ActorImageType]: { width: number, height: number }[]} = {
+  [ActorImageType.AVATAR]: [
+    {
+      width: 120,
+      height: 120
+    },
+    {
+      width: 48,
+      height: 48
+    }
+  ],
+  [ActorImageType.BANNER]: [
+    {
+      width: 1920,
+      height: 317 // 6/1 ratio
+    }
+  ]
 }
 
 const EMBED_SIZE = {
@@ -1102,6 +1112,10 @@ function buildLanguages () {
   languages['oc'] = 'Occitan'
   languages['el'] = 'Greek'
 
+  // Chinese languages
+  languages['zh-Hans'] = 'Simplified Chinese'
+  languages['zh-Hant'] = 'Traditional Chinese'
+
   return languages
 }