]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/video-transcoding.ts
Suffix external auth username on conflict
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / video-transcoding.ts
index 5afca65cab154fa62be86e5f2a0eb8a18a111d85..d3fb7778b76487e214e216fa2445644260ebfd50 100644 (file)
@@ -26,6 +26,7 @@ import {
   optimizeOriginalVideofile,
   transcodeNewWebTorrentResolution
 } from '../../transcoding/transcoding'
+import { Hooks } from '@server/lib/plugins/hooks'
 
 type HandlerFunction = (job: Job, payload: VideoTranscodingPayload, video: MVideoFullLight, user: MUser) => Promise<void>
 
@@ -149,7 +150,7 @@ async function onHlsPlaylistGeneration (video: MVideoFullLight, user: MUser, pay
   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()
     }
 
@@ -269,7 +270,12 @@ async function createLowerResolutionsJobs (options: {
   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) {