mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-11 06:42:38 +02:00
validate mpv extra parameters to prevent empty string param (#2058)
This commit is contained in:
@@ -120,8 +120,14 @@ const createMpv = async (data: {
|
|||||||
}): Promise<MpvAPI> => {
|
}): Promise<MpvAPI> => {
|
||||||
const { binaryPath, extraParameters, properties } = data;
|
const { binaryPath, extraParameters, properties } = data;
|
||||||
const resolvedBinaryPath = await resolveMpvBinaryPath(binaryPath);
|
const resolvedBinaryPath = await resolveMpvBinaryPath(binaryPath);
|
||||||
|
const normalizedExtraParameters = (extraParameters ?? [])
|
||||||
|
.map((param) => param.trim())
|
||||||
|
.filter((param) => param.length > 0);
|
||||||
|
|
||||||
const params = uniq([...DEFAULT_MPV_PARAMETERS(extraParameters), ...(extraParameters || [])]);
|
const params = uniq([
|
||||||
|
...DEFAULT_MPV_PARAMETERS(normalizedExtraParameters),
|
||||||
|
...normalizedExtraParameters,
|
||||||
|
]);
|
||||||
|
|
||||||
const mpv = new MpvAPI(
|
const mpv = new MpvAPI(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user