diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-05 15:05:20 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-09 09:18:07 +0200 |
commit | 5e2afe4290103bf0d54ae7b3e62781f2a00487c9 (patch) | |
tree | 84e084135c60d208fc9afcee63180d3200f763e6 /server/controllers/api | |
parent | 64fd6158fd276f258bcfc4bb0c8fc2f64a220a11 (diff) | |
download | PeerTube-5e2afe4290103bf0d54ae7b3e62781f2a00487c9.tar.gz PeerTube-5e2afe4290103bf0d54ae7b3e62781f2a00487c9.tar.zst PeerTube-5e2afe4290103bf0d54ae7b3e62781f2a00487c9.zip |
Limit import depending on transcoding resolutions
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/config.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/import.ts | 6 | ||||
-rw-r--r-- | server/controllers/api/videos/transcoding.ts | 2 |
3 files changed, 8 insertions, 2 deletions
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' | |||
10 | import { ClientHtml } from '../../lib/client-html' | 10 | import { ClientHtml } from '../../lib/client-html' |
11 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' | 11 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' |
12 | import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config' | 12 | import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config' |
13 | import { logger } from '@server/helpers/logger' | ||
13 | 14 | ||
14 | const configRouter = express.Router() | 15 | const configRouter = express.Router() |
15 | 16 | ||
@@ -112,6 +113,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response) | |||
112 | 113 | ||
113 | const data = customConfig() | 114 | const data = customConfig() |
114 | 115 | ||
116 | logger.info('coucou', { data }) | ||
115 | auditLogger.update( | 117 | auditLogger.update( |
116 | getAuditIdFromRes(res), | 118 | getAuditIdFromRes(res), |
117 | new CustomConfigAuditView(data), | 119 | 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) | |||
175 | const targetUrl = body.targetUrl | 175 | const targetUrl = body.targetUrl |
176 | const user = res.locals.oauth.token.User | 176 | const user = res.locals.oauth.token.User |
177 | 177 | ||
178 | const youtubeDL = new YoutubeDLWrapper(targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) | 178 | const youtubeDL = new YoutubeDLWrapper( |
179 | targetUrl, | ||
180 | ServerConfigManager.Instance.getEnabledResolutions('vod'), | ||
181 | CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION | ||
182 | ) | ||
179 | 183 | ||
180 | // Get video infos | 184 | // Get video infos |
181 | let youtubeDLInfo: YoutubeDLInfo | 185 | 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) { | |||
32 | 32 | ||
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({ input: maxResolution, type: 'vod', includeInput: true, strictLower: false }), |
36 | 'filter:transcoding.manual.resolutions-to-transcode.result', | 36 | 'filter:transcoding.manual.resolutions-to-transcode.result', |
37 | body | 37 | body |
38 | ) | 38 | ) |