diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-05 13:40:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-09 09:18:07 +0200 |
commit | 64fd6158fd276f258bcfc4bb0c8fc2f64a220a11 (patch) | |
tree | 16deccc689788a3832ea3097fae8e4ccb30cabe3 | |
parent | 84cae54e7a2595bea0c3ea106a4d111fd11a4ec6 (diff) | |
download | PeerTube-64fd6158fd276f258bcfc4bb0c8fc2f64a220a11.tar.gz PeerTube-64fd6158fd276f258bcfc4bb0c8fc2f64a220a11.tar.zst PeerTube-64fd6158fd276f258bcfc4bb0c8fc2f64a220a11.zip |
Fix resolution to transcode hook name
-rw-r--r-- | server/controllers/api/videos/transcoding.ts | 2 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 2 | ||||
-rw-r--r-- | server/lib/live/live-manager.ts | 2 | ||||
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 2 | ||||
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 2 | ||||
-rw-r--r-- | shared/models/plugins/server/server-hook.model.ts | 4 |
6 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts index 09ab7dc0f..7d924c5ac 100644 --- a/server/controllers/api/videos/transcoding.ts +++ b/server/controllers/api/videos/transcoding.ts | |||
@@ -33,7 +33,7 @@ async function createTranscoding (req: express.Request, res: express.Response) { | |||
33 | const { resolution: maxResolution, audioStream } = await video.probeMaxQualityFile() | 33 | const { resolution: maxResolution, audioStream } = await video.probeMaxQualityFile() |
34 | const resolutions = await Hooks.wrapObject( | 34 | const resolutions = await Hooks.wrapObject( |
35 | computeResolutionsToTranscode({ inputResolution: maxResolution, type: 'vod', includeInputResolution: true }), | 35 | computeResolutionsToTranscode({ inputResolution: maxResolution, type: 'vod', includeInputResolution: true }), |
36 | 'filter:transcoding.manual.lower-resolutions-to-transcode.result', | 36 | 'filter:transcoding.manual.resolutions-to-transcode.result', |
37 | body | 37 | body |
38 | ) | 38 | ) |
39 | 39 | ||
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index b07876a1c..890d34e3b 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -266,7 +266,7 @@ async function createLowerResolutionsJobs (options: { | |||
266 | // Create transcoding jobs if there are enabled resolutions | 266 | // Create transcoding jobs if there are enabled resolutions |
267 | const resolutionsEnabled = await Hooks.wrapObject( | 267 | const resolutionsEnabled = await Hooks.wrapObject( |
268 | computeResolutionsToTranscode({ inputResolution: videoFileResolution, type: 'vod', includeInputResolution: false }), | 268 | computeResolutionsToTranscode({ inputResolution: videoFileResolution, type: 'vod', includeInputResolution: false }), |
269 | 'filter:transcoding.auto.lower-resolutions-to-transcode.result', | 269 | 'filter:transcoding.auto.resolutions-to-transcode.result', |
270 | options | 270 | options |
271 | ) | 271 | ) |
272 | 272 | ||
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index 1d1ecd935..3ac57fa44 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts | |||
@@ -245,7 +245,7 @@ class LiveManager { | |||
245 | 245 | ||
246 | const allResolutions = await Hooks.wrapObject( | 246 | const allResolutions = await Hooks.wrapObject( |
247 | this.buildAllResolutionsToTranscode(resolution), | 247 | this.buildAllResolutionsToTranscode(resolution), |
248 | 'filter:transcoding.auto.lower-resolutions-to-transcode.result', | 248 | 'filter:transcoding.auto.resolutions-to-transcode.result', |
249 | { video } | 249 | { video } |
250 | ) | 250 | ) |
251 | 251 | ||
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index b3febfa12..813482a27 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -301,7 +301,7 @@ async function register ({ registerHook, registerSetting, settingsManager, stora | |||
301 | }) | 301 | }) |
302 | 302 | ||
303 | registerHook({ | 303 | registerHook({ |
304 | target: 'filter:transcoding.auto.lower-resolutions-to-transcode.result', | 304 | target: 'filter:transcoding.auto.resolutions-to-transcode.result', |
305 | handler: (object, context) => { | 305 | handler: (object, context) => { |
306 | if (context.video.name.includes('transcode-filter')) { | 306 | if (context.video.name.includes('transcode-filter')) { |
307 | object = [ 100 ] | 307 | object = [ 100 ] |
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index 015459ead..7e98d9be6 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -680,7 +680,7 @@ describe('Test plugin filter hooks', function () { | |||
680 | 680 | ||
681 | describe('Transcoding filters', async function () { | 681 | describe('Transcoding filters', async function () { |
682 | 682 | ||
683 | it('Should run filter:transcoding.auto.lower-resolutions-to-transcode.result', async function () { | 683 | it('Should run filter:transcoding.auto.resolutions-to-transcode.result', async function () { |
684 | const { uuid } = await servers[0].videos.quickUpload({ name: 'transcode-filter' }) | 684 | const { uuid } = await servers[0].videos.quickUpload({ name: 'transcode-filter' }) |
685 | 685 | ||
686 | await waitJobs(servers) | 686 | await waitJobs(servers) |
diff --git a/shared/models/plugins/server/server-hook.model.ts b/shared/models/plugins/server/server-hook.model.ts index c8e879323..5bf01c4b4 100644 --- a/shared/models/plugins/server/server-hook.model.ts +++ b/shared/models/plugins/server/server-hook.model.ts | |||
@@ -102,8 +102,8 @@ export const serverFilterHookObject = { | |||
102 | 'filter:job-queue.process.params': true, | 102 | 'filter:job-queue.process.params': true, |
103 | 'filter:job-queue.process.result': true, | 103 | 'filter:job-queue.process.result': true, |
104 | 104 | ||
105 | 'filter:transcoding.manual.lower-resolutions-to-transcode.result': true, | 105 | 'filter:transcoding.manual.resolutions-to-transcode.result': true, |
106 | 'filter:transcoding.auto.lower-resolutions-to-transcode.result': true | 106 | 'filter:transcoding.auto.resolutions-to-transcode.result': true |
107 | } | 107 | } |
108 | 108 | ||
109 | export type ServerFilterHookName = keyof typeof serverFilterHookObject | 109 | export type ServerFilterHookName = keyof typeof serverFilterHookObject |