api/match-action: support forced local processing

This commit is contained in:
wukko 2025-06-22 16:21:37 +06:00
parent a6b599a828
commit 28ab2747ce
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -20,7 +20,7 @@ export default function({
requestIP,
audioBitrate,
alwaysProxy,
localProcessing
localProcessing,
}) {
let action,
responseType = "tunnel",
@ -242,15 +242,20 @@ export default function({
defaultParams.filename += `.${audioFormat}`;
}
if (alwaysProxy && responseType === "redirect") {
if ((alwaysProxy || localProcessing === "forced") && responseType === "redirect") {
responseType = "tunnel";
params.type = "proxy";
}
// TODO: add support for HLS
// (very painful)
if (localProcessing && !params.isHLS && extraProcessingTypes.includes(params.type)) {
responseType = "local-processing";
if (!params.isHLS) {
const isPreferredWithExtra =
localProcessing === "preferred" && extraProcessingTypes.includes(params.type);
if (localProcessing === "forced" || isPreferredWithExtra) {
responseType = "local-processing";
}
}
// extractors usually return ISO 639-1 language codes,