scripts: switch to using JsonUtils.match_rules_apply_properties()
Note: this requires all existing config files to be modified to follow pipewire's rules syntax, with an "actions" object wrapping the "update-props" object.
This commit is contained in:
@@ -72,15 +72,15 @@ function cutils.get_default_metadata_object ()
|
||||
end
|
||||
|
||||
function cutils.evaluateRulesApplyProperties (properties, name)
|
||||
local matched, mprops = Conf.apply_rules (name, properties)
|
||||
local section = Conf.get_section (name)
|
||||
local matched, mprops = JsonUtils.match_rules_update_properties (
|
||||
section, properties)
|
||||
|
||||
if (matched and mprops) then
|
||||
if (matched > 0 and mprops) then
|
||||
for k, v in pairs (mprops) do
|
||||
properties [k] = v
|
||||
end
|
||||
end
|
||||
|
||||
return matched and mprops
|
||||
end
|
||||
|
||||
-- simple serializer {"foo", "bar"} -> "foo;bar;"
|
||||
|
Reference in New Issue
Block a user