| 1 |
-- WirePlumber |
| 2 |
-- |
| 3 |
-- Copyright © 2023 Collabora Ltd. |
| 4 |
-- |
| 5 |
-- SPDX-License-Identifier: MIT |
| 6 |
-- |
| 7 |
-- Provides the default metadata object |
| 8 |
|
| 9 |
Script.async_activation = true |
| 10 |
|
| 11 |
-- note that args is a WpSpaJson |
| 12 |
local args = ... |
| 13 |
args = args:parse(1) |
| 14 |
|
| 15 |
local metadata_name = args["metadata.name"] |
| 16 |
|
| 17 |
log = Log.open_topic ("s-metadata") |
| 18 |
log:info ("creating metadata object: " .. metadata_name) |
| 19 |
|
| 20 |
impl_metadata = ImplMetadata (metadata_name) |
| 21 |
impl_metadata:activate (Features.ALL, function (m, e) |
| 22 |
if e then |
| 23 |
Script:finish_activation_with_error ( |
| 24 |
"failed to activate the ".. metadata_name .." metadata: " .. tostring (e)) |
| 25 |
else |
| 26 |
Script:finish_activation () |
| 27 |
end |
| 28 |
end) |