mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Add ability to put captions in object storage
Deprecate: * `path` and `url` of `ActorImage` (used to represent account/channel avatars/banners) in favour of `fileUrl` * `path` of `AvatarInfo` (used in notifications) in favour of `fileUrl` * `captionPath` of `VideoCaption` in favour of `fileUrl` * `storyboardPath` of `Storyboard` in favour of `fileUrl`
This commit is contained in:
parent
e6725e6d3a
commit
260447942a
69 changed files with 1322 additions and 518 deletions
|
@ -1,4 +1,4 @@
|
|||
import { VideoFileStream } from '@peertube/peertube-models'
|
||||
import { FileStorage, VideoFileStream } from '@peertube/peertube-models'
|
||||
import { buildSUUID } from '@peertube/peertube-node-utils'
|
||||
import { AbstractTranscriber, TranscriptionModel, WhisperBuiltinModel, transcriberFactory } from '@peertube/peertube-transcription'
|
||||
import { moveAndProcessCaptionFile } from '@server/helpers/captions-utils.js'
|
||||
|
@ -34,6 +34,7 @@ export async function createLocalCaption (options: {
|
|||
const videoCaption = new VideoCaptionModel({
|
||||
videoId: video.id,
|
||||
filename: VideoCaptionModel.generateCaptionName(language),
|
||||
storage: FileStorage.FILE_SYSTEM,
|
||||
language,
|
||||
automaticallyGenerated
|
||||
}) as MVideoCaption
|
||||
|
@ -46,6 +47,12 @@ export async function createLocalCaption (options: {
|
|||
})
|
||||
})
|
||||
|
||||
if (CONFIG.OBJECT_STORAGE.ENABLED) {
|
||||
await JobQueue.Instance.createJob({ type: 'move-to-object-storage', payload: { captionId: videoCaption.id } })
|
||||
}
|
||||
|
||||
logger.info(`Created/replaced caption ${videoCaption.filename} of ${language} of video ${video.uuid}`, lTags(video.uuid))
|
||||
|
||||
return Object.assign(videoCaption, { Video: video })
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue