From 5e2afe4290103bf0d54ae7b3e62781f2a00487c9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Aug 2022 15:05:20 +0200 Subject: Limit import depending on transcoding resolutions --- server/controllers/api/config.ts | 2 ++ server/controllers/api/videos/import.ts | 6 +++++- server/controllers/api/videos/transcoding.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index ff2fa9d86..19bd2888c 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -10,6 +10,7 @@ import { CONFIG, reloadConfig } from '../../initializers/config' import { ClientHtml } from '../../lib/client-html' import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config' +import { logger } from '@server/helpers/logger' const configRouter = express.Router() @@ -112,6 +113,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response) const data = customConfig() + logger.info('coucou', { data }) auditLogger.update( getAuditIdFromRes(res), new CustomConfigAuditView(data), diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 7576e77e7..b12953630 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -175,7 +175,11 @@ async function addYoutubeDLImport (req: express.Request, res: express.Response) const targetUrl = body.targetUrl const user = res.locals.oauth.token.User - const youtubeDL = new YoutubeDLWrapper(targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) + const youtubeDL = new YoutubeDLWrapper( + targetUrl, + ServerConfigManager.Instance.getEnabledResolutions('vod'), + CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION + ) // Get video infos let youtubeDLInfo: YoutubeDLInfo diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts index 7d924c5ac..b2b71a870 100644 --- a/server/controllers/api/videos/transcoding.ts +++ b/server/controllers/api/videos/transcoding.ts @@ -32,7 +32,7 @@ async function createTranscoding (req: express.Request, res: express.Response) { const { resolution: maxResolution, audioStream } = await video.probeMaxQualityFile() const resolutions = await Hooks.wrapObject( - computeResolutionsToTranscode({ inputResolution: maxResolution, type: 'vod', includeInputResolution: true }), + computeResolutionsToTranscode({ input: maxResolution, type: 'vod', includeInput: true, strictLower: false }), 'filter:transcoding.manual.resolutions-to-transcode.result', body ) -- cgit v1.2.3