Skip to content
Snippets Groups Projects
Commit db848123 authored by David Trattnig's avatar David Trattnig
Browse files

Fix(playlog): Metadata encoding (engine#80)

parent 82e3d841
No related branches found
No related tags found
No related merge requests found
......@@ -38,11 +38,12 @@ inputs = ref []
def on_metadata_notification(meta) =
filename = meta["filename"]
track_duration = request.duration(filename)
json_data = json_of(meta)
json_data = '{ "action": "on_metadata", "data": #{json_data}, "track_duration": "#{track_duration}" }'
# There's currently an issue with Liquidsoap http.post requests:
# headers = [("Content-Type","application/json; charset=utf-8")]
# ignore(http.post(headers=headers, data="#{json_data}", "http://#{engine_control}"))
json_data = json_of(meta, compact=true)
json_data = url.encode(json_data)
json_data = '{ "action": "on_metadata", "meta": "#{json_data}", "track_duration": "#{track_duration}" }'
# There's currently an issue with Liquidsoap http.post requests (should be gone with Liquidsoap 2):
#headers = [("Content-Type","application/json; charset=utf-8")]
#ignore(http.post(headers=headers, data="#{json_data}", "localhost:1337"))
ignore(system("curl -X POST -H 'Content-Type: application/json' --data '#{json_data}' #{engine_control}"))
end
......
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