-function buildVideo (channelId: number, body: VideoImportCreate, importData: YoutubeDLInfo) {
- const videoData = {
- name: body.name || importData.name || 'Unknown name',
- remote: false,
- category: body.category || importData.category,
- licence: body.licence || importData.licence,
- language: body.language || undefined,
- commentsEnabled: body.commentsEnabled || true,
- downloadEnabled: body.downloadEnabled || true,
- waitTranscoding: body.waitTranscoding || false,
- state: VideoState.TO_IMPORT,
- nsfw: body.nsfw || importData.nsfw || false,
- description: body.description || importData.description,
- support: body.support || null,
- privacy: body.privacy || VideoPrivacy.PRIVATE,
- duration: 0, // duration will be set by the import job
- channelId: channelId,
- originallyPublishedAt: importData.originallyPublishedAt
- }
- const video = new VideoModel(videoData)
- video.url = getVideoActivityPubUrl(video)
-
- return video
-}
-
-async function processThumbnail (req: express.Request, video: VideoModel) {