optimizeOriginalVideofile,
transcodeNewWebTorrentResolution
} from '../../transcoding/transcoding'
+import { Hooks } from '@server/lib/plugins/hooks'
type HandlerFunction = (job: Job, payload: VideoTranscodingPayload, video: MVideoFullLight, user: MUser) => Promise<void>
if (payload.isMaxQuality && payload.autoDeleteWebTorrentIfNeeded && CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) {
// Remove webtorrent files if not enabled
for (const file of video.VideoFiles) {
- await video.removeWebTorrentFileAndTorrent(file)
+ await video.removeWebTorrentFile(file)
await file.destroy()
}
const { video, user, videoFileResolution, isPortraitMode, isNewVideo, hasAudio, type } = options
// Create transcoding jobs if there are enabled resolutions
- const resolutionsEnabled = computeLowerResolutionsToTranscode(videoFileResolution, 'vod')
+ const resolutionsEnabled = await Hooks.wrapObject(
+ computeLowerResolutionsToTranscode(videoFileResolution, 'vod'),
+ 'filter:transcoding.auto.lower-resolutions-to-transcode.result',
+ options
+ )
+
const resolutionCreated: string[] = []
for (const resolution of resolutionsEnabled) {