1
0
Fork 0
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:
Chocobozzz 2025-02-07 09:04:20 +01:00
parent e6725e6d3a
commit 260447942a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
69 changed files with 1322 additions and 518 deletions

View file

@ -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 })
}