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

Merge branch 'topic/camelCase-API' into 'main'

Update all API to return attributes / properties in camelCase notation

See merge request !5
parents 4cb86564 9a1a0f6f
No related branches found
No related tags found
1 merge request!5Update all API to return attributes / properties in camelCase notation
Pipeline #3530 passed
......@@ -13,7 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Configuration: Increase default value for Engine Core server timeout, to avoid malfunctions when idle (aura#165)
- Make properties in API schemas in CamelCase notation (aura#141)
- Configuration: Renamed environment variable `AURA_ENGINE_SERVER_TIMEOUT` to `AURA_ENGINE_SERVER_TIMEOUT`
and configuration setting `telnet_server_timeout` to `server_timeout`.
- Configuration: Increase default value for `server_timeout`, to avoid malfunctions when idle (aura#165)
### Deprecated
......
1.0.0-alpha1
\ No newline at end of file
1.0.0-alpha2
\ No newline at end of file
......@@ -21,12 +21,12 @@ api_url_playlog="http://0.0.0.0:8008/api/v1/playlog"
audio_playlist_folder="/var/audio/playlist"
[telnet]
[server]
##################################################################################################
# server_timeout="16380"
# telnet_server_enable="true"
# telnet_server_host="0.0.0.0"
# telnet_server_port="1234"
# telnet_server_timeout="16380"
[fallback]
......
......@@ -21,12 +21,12 @@ api_url_playlog="http://127.0.0.1:8008/api/v1/playlog"
; audio_playlist_folder="../audio/playlist"
[telnet]
[server]
##################################################################################################
# server_timeout="16380"
# telnet_server_enable="true"
# telnet_server_host="127.0.0.1"
# telnet_server_port="1234"
# telnet_server_timeout="16380"
[fallback]
......
......@@ -21,11 +21,11 @@ AURA_ENGINE_FRAME_DURATION=
AURA_ENGINE_FRAME_SIZE=
AURA_ENGINE_API_URL_PLAYLOG=http://172.17.0.1:8008/api/v1/playlog
# Telnet Settings
# Server Settings
AURA_ENGINE_SERVER_TIMEOUT=16380.
AURA_ENGINE_TELNET_ENABLE=true
AURA_ENGINE_TELNET_HOST=0.0.0.0
AURA_ENGINE_TELNET_PORT=1234
AURA_ENGINE_TELNET_SERVER_TIMEOUT=16380.
# Stream Input Settings
AURA_ENGINE_STREAM_INPUT_MAX_BUFFER=5.0
......
......@@ -46,9 +46,8 @@ def on_metadata_notification(meta) =
end
playlog = [
("log_source", engine_id),
("show_name", !show_name),
("show_id", !show_id),
("show_name", !show_name),
("timeslot_id", timeslot_id),
("playlist_id", playlist_id),
("track_type", track_type),
......@@ -57,7 +56,8 @@ def on_metadata_notification(meta) =
("track_title", track_title),
("track_album", track_album),
("track_artist", track_artist),
("track_num", playlist_track_num)
("track_num", playlist_track_num),
("log_source", engine_id)
]
if playlog["show_id"] == "" then
log(level=3, label="metadata", "Skip posting playlog because of missing show ID!")
......
......@@ -137,20 +137,20 @@ end
def post_playlog(api_url, data) =
json_data = json()
json_data.add("log_source", int_of_string(list.assoc("log_source", data)))
json_data.add("show_name", list.assoc("show_name", data))
json_data.add("show_id", int_of_string(list.assoc("show_id", data)))
json_data.add("timeslot_id", int_of_string(list.assoc("timeslot_id", data)))
json_data.add("playlist_id", int_of_string(list.assoc("playlist_id", data)))
json_data.add("track_type", int_of_string(list.assoc("track_type", data)))
json_data.add("track_start", list.assoc("track_start", data))
json_data.add("track_duration", int_of_string(list.assoc("track_duration", data)))
json_data.add("track_title", list.assoc("track_title", data))
json_data.add("track_album", list.assoc("track_album", data))
json_data.add("track_artist", list.assoc("track_artist", data))
json_data.add("showId", int_of_string(list.assoc("show_id", data)))
json_data.add("showName", list.assoc("show_name", data))
json_data.add("timeslotId", int_of_string(list.assoc("timeslot_id", data)))
json_data.add("playlistId", int_of_string(list.assoc("playlist_id", data)))
json_data.add("trackType", int_of_string(list.assoc("track_type", data)))
json_data.add("trackStart", list.assoc("track_start", data))
json_data.add("trackDuration", int_of_string(list.assoc("track_duration", data)))
json_data.add("trackTitle", list.assoc("track_title", data))
json_data.add("trackAlbum", list.assoc("track_album", data))
json_data.add("trackArtist", list.assoc("track_artist", data))
if list.assoc("track_num", data) != "" then
json_data.add("track_num", int_of_string(list.assoc("track_num", data)))
json_data.add("trackNum", int_of_string(list.assoc("track_num", data)))
end
json_data.add("logSource", int_of_string(list.assoc("log_source", data)))
playlog = json.stringify(json_data)
log("Posting playlog to '#{api_url}': #{playlog}")
......
......@@ -51,19 +51,20 @@ else
settings.init.allow_root.set(false)
end
# TELNET SETTINGS
# SERVER SETTINGS
server_timeout = float_of_string(get_setting("16380.", "server_timeout", "AURA_ENGINE_SERVER_TIMEOUT"))
settings.server.timeout.set(server_timeout)
telnet_server_enable = get_setting("true", "telnet_server_enable", "AURA_ENGINE_TELNET_ENABLE")
telnet_server_host = get_setting("127.0.0.1", "telnet_server_host", "AURA_ENGINE_TELNET_HOST")
telnet_server_port = int_of_string(get_setting("1234", "telnet_server_port", "AURA_ENGINE_TELNET_PORT"))
telnet_server_timeout = float_of_string(get_setting("16380.", "telnet_server_timeout", "AURA_ENGINE_TELNET_SERVER_TIMEOUT"))
if telnet_server_enable != "true" then
print("\tLiquidsoap Telnet Server: disabled")
settings.server.telnet.set(false)
else
print("\tLiquidsoap Telnet Server at #{telnet_server_host}:#{telnet_server_port} (#{telnet_server_timeout}s timeout)")
print("\tLiquidsoap Telnet Server at #{telnet_server_host}:#{telnet_server_port} (#{server_timeout}s timeout)")
settings.server.telnet.bind_addr.set(telnet_server_host)
settings.server.telnet.port.set(telnet_server_port)
settings.server.timeout.set(telnet_server_timeout)
settings.server.telnet.set(true)
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