mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Implement captions/subtitles
This commit is contained in:
parent
d4557fd3ec
commit
40e87e9ecc
83 changed files with 1867 additions and 298 deletions
|
@ -80,6 +80,14 @@ async function getConfig (req: express.Request, res: express.Response, next: exp
|
|||
extensions: CONSTRAINTS_FIELDS.VIDEOS.EXTNAME
|
||||
}
|
||||
},
|
||||
videoCaption: {
|
||||
file: {
|
||||
size: {
|
||||
max: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max
|
||||
},
|
||||
extensions: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.EXTNAME
|
||||
}
|
||||
},
|
||||
user: {
|
||||
videoQuota: CONFIG.USER.VIDEO_QUOTA
|
||||
}
|
||||
|
@ -122,12 +130,13 @@ async function updateCustomConfig (req: express.Request, res: express.Response,
|
|||
|
||||
// Force number conversion
|
||||
toUpdate.cache.previews.size = parseInt('' + toUpdate.cache.previews.size, 10)
|
||||
toUpdate.cache.captions.size = parseInt('' + toUpdate.cache.captions.size, 10)
|
||||
toUpdate.signup.limit = parseInt('' + toUpdate.signup.limit, 10)
|
||||
toUpdate.user.videoQuota = parseInt('' + toUpdate.user.videoQuota, 10)
|
||||
toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10)
|
||||
|
||||
// camelCase to snake_case key
|
||||
const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription')
|
||||
const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription', 'cache.videoCaptions')
|
||||
toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota
|
||||
toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute
|
||||
toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription
|
||||
|
@ -172,6 +181,9 @@ function customConfig (): CustomConfig {
|
|||
cache: {
|
||||
previews: {
|
||||
size: CONFIG.CACHE.PREVIEWS.SIZE
|
||||
},
|
||||
captions: {
|
||||
size: CONFIG.CACHE.VIDEO_CAPTIONS.SIZE
|
||||
}
|
||||
},
|
||||
signup: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue