Skip to content
Snippets Groups Projects
Verified Commit 6f2f1cda authored by Ole Binder's avatar Ole Binder
Browse files

Fix: Re-enable icy.update_metadata function

parent 419b2bba
No related branches found
No related tags found
1 merge request!17Yaml configuration file
Pipeline #7795 passed
...@@ -119,25 +119,11 @@ server.register( ...@@ -119,25 +119,11 @@ server.register(
) )
so = [] so = []
# TODO: add all lineouts
so = so =
s0_enable ? list.add(("out_line_0", ("connected", "stream0")), so) : so s0_enable ? list.add(("out_line_0", ("connected", "stream0")), so) : so
# so =
# s1_enable
# ? list.add(("out_line_1", ("connected", "#{s1_connected()}")), so) : so
# so =
# s2_enable
# ? list.add(("out_line_2", ("connected", "#{s2_connected()}")), so) : so
# so =
# s3_enable
# ? list.add(("out_line_3", ("connected", "#{s3_connected()}")), so) : so
# so =
# s4_enable
# ? list.add(("out_line_4", ("connected", "#{s4_connected()}")), so) : so
# lo = a1_out != '' ? list.add("out_line_1", lo) : lo
# lo = a2_out != '' ? list.add("out_line_2", lo) : lo
# lo = a3_out != '' ? list.add("out_line_3", lo) : lo
# lo = a4_out != '' ? list.add("out_line_4", lo) : lo
json_data = json() json_data = json()
json_data.add("line", lo_list()) json_data.add("line", lo_list())
json_data.add("stream", so) json_data.add("stream", so)
...@@ -231,97 +217,50 @@ server.register( ...@@ -231,97 +217,50 @@ server.register(
fadeTo fadeTo
) )
# def icy_update(v) = # TODO: reimplement this as list based approach
# # Parse the argument
# l = string.split(separator=",", v)
# def split(l, v) =
# v = string.split(separator="=", v)
# if
# list.length(v) >= 2
# then
# list.append(l, [(list.nth(v, 0, default=""), list.nth(v, 1, default=""))])
# else
# l
# end
# end
# meta = list.fold(split, [], l)
# # Update metadata
# if
# s0_enable == true
# then
# icy.update_metadata(
# mount=s0_mount,
# user=s0_user,
# password=s0_pass,
# host=s0_host,
# port=s0_port,
# meta
# )
# end
# if
# s1_enable == true
# then
# icy.update_metadata(
# mount=s1_mount,
# user=s1_user,
# password=s1_pass,
# host=s1_host,
# port=s1_port,
# meta
# )
# end
# if
# s2_enable == true
# then
# icy.update_metadata(
# mount=s2_mount,
# user=s2_user,
# password=s2_pass,
# host=s2_host,
# port=s2_port,
# meta
# )
# end
# if def icy_update(v) =
# s3_enable == true # Parse the argument
# then l = string.split(separator=",", v)
# icy.update_metadata( def split(l, v) =
# mount=s3_mount, v = string.split(separator="=", v)
# user=s3_user, if
# password=s3_pass, list.length(v) >= 2
# host=s3_host, then
# port=s3_port, list.append(l, [(list.nth(v, 0, default=""), list.nth(v, 1, default=""))])
# meta else
# ) l
# end end
end
meta = list.fold(split, [], l)
# if # Update metadata
# s4_enable == true def update_metadata(stream) =
# then if
# icy.update_metadata( stream.enabled
# mount=s4_mount, then
# user=s4_user, icy.update_metadata(
# password=s4_pass, mount=stream.mountpoint,
# host=s4_host, user=stream.user,
# port=s4_port, password=stream.password,
# meta host=stream.host,
# ) port=int_of_float(stream.port),
# end meta
)
end
end
# "OK" list.iter(update_metadata, config.stream)
# end
"OK"
end
# server.register( server.register(
# "update", "update",
# namespace="metadata", namespace="metadata",
# description= description=
# "Update metadata", "Update metadata",
# usage= usage=
# "update title=foo,album=bar, ...", "update title=foo,album=bar, ...",
# icy_update icy_update
# ) )
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment