mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +00:00
api/match-action: support forced local processing
This commit is contained in:
parent
a6b599a828
commit
28ab2747ce
@ -20,7 +20,7 @@ export default function({
|
|||||||
requestIP,
|
requestIP,
|
||||||
audioBitrate,
|
audioBitrate,
|
||||||
alwaysProxy,
|
alwaysProxy,
|
||||||
localProcessing
|
localProcessing,
|
||||||
}) {
|
}) {
|
||||||
let action,
|
let action,
|
||||||
responseType = "tunnel",
|
responseType = "tunnel",
|
||||||
@ -242,15 +242,20 @@ export default function({
|
|||||||
defaultParams.filename += `.${audioFormat}`;
|
defaultParams.filename += `.${audioFormat}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alwaysProxy && responseType === "redirect") {
|
if ((alwaysProxy || localProcessing === "forced") && responseType === "redirect") {
|
||||||
responseType = "tunnel";
|
responseType = "tunnel";
|
||||||
params.type = "proxy";
|
params.type = "proxy";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add support for HLS
|
// TODO: add support for HLS
|
||||||
// (very painful)
|
// (very painful)
|
||||||
if (localProcessing && !params.isHLS && extraProcessingTypes.includes(params.type)) {
|
if (!params.isHLS) {
|
||||||
responseType = "local-processing";
|
const isPreferredWithExtra =
|
||||||
|
localProcessing === "preferred" && extraProcessingTypes.includes(params.type);
|
||||||
|
|
||||||
|
if (localProcessing === "forced" || isPreferredWithExtra) {
|
||||||
|
responseType = "local-processing";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// extractors usually return ISO 639-1 language codes,
|
// extractors usually return ISO 639-1 language codes,
|
||||||
|
Loading…
Reference in New Issue
Block a user