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

Post metadata via socket. #43 #44

parent c0e0737f
No related branches found
No related tags found
No related merge requests found
......@@ -35,10 +35,12 @@ inputs = ref []
# Called when some new metadata info is available
def on_metadata_notification(meta) =
filename = meta["filename"]
# artist = meta["artist"]
# title = meta["title"]
system('#{list.assoc(default="", "install_dir", ini)}/guru.py --on_play "#{filename}"')
json_data = json_of(meta)
json_data = '{ "action": "on_metadata", "data": #{json_data} }'
# 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://localhost:1337"))
ignore(system("curl -X POST -H 'Content-Type: application/json' --data '#{json_data}' localhost:1337"))
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