From ebb9e53ada156249ed8e8cfd1de74097d3eb49d7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 2 Aug 2022 16:05:44 +0200 Subject: Add plugin hook on transcoding resolutions building --- server/tests/fixtures/peertube-plugin-test/main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'server/tests/fixtures') diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index f62f6a435..c395ac7aa 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js @@ -256,8 +256,6 @@ async function register ({ registerHook, registerSetting, settingsManager, stora registerHook({ target: 'filter:job-queue.process.params', handler: (object, context) => { - peertubeHelpers.logger.debug('TOTO.', { object, context }) - if (context.type !== 'video-studio-edition') return object object.data.tasks = [ @@ -274,6 +272,17 @@ async function register ({ registerHook, registerSetting, settingsManager, stora } }) + registerHook({ + target: 'filter:transcoding.auto.lower-resolutions-to-transcode.result', + handler: (object, context) => { + if (context.video.name.includes('transcode-filter')) { + object = [ 100 ] + } + + return object + } + }) + // Upload/import/live attributes for (const target of [ 'filter:api.video.upload.video-attribute.result', -- cgit v1.2.3