import express from 'express'
import { join } from 'path'
+import { ffprobePromise } from '@server/helpers/ffmpeg/ffprobe-utils'
import { buildLogger } from '@server/helpers/logger'
import { CONFIG } from '@server/initializers/config'
import { WEBSERVER } from '@server/initializers/constants'
removeVideo: (id: number) => {
return sequelizeTypescript.transaction(async t => {
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t)
+ const video = await VideoModel.loadFull(id, t)
await video.destroy({ transaction: t })
})
},
+ ffprobe: (path: string) => {
+ return ffprobePromise(path)
+ },
+
getFiles: async (id: number | string) => {
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
+ const video = await VideoModel.loadFull(id)
if (!video) return undefined
const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({
},
blacklistVideo: async (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => {
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID)
+ const video = await VideoModel.loadFull(options.videoIdOrUUID)
if (!video) return
await blacklistVideo(video, options.createOptions)
},
unblacklistVideo: async (options: { videoIdOrUUID: number | string }) => {
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID)
+ const video = await VideoModel.loadFull(options.videoIdOrUUID)
if (!video) return
const videoBlacklist = await VideoBlacklistModel.loadByVideoId(video.id)