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

Feat: read yaml config file

parent 0b0a079a
No related branches found
No related tags found
1 merge request!17Yaml configuration file
......@@ -29,8 +29,60 @@ config_file =
print(
"\tConfig file: '#{config_file}'"
)
ini = read_ini(config_file)
engine_config_folder = string.split(separator="/engine-core.ini", config_file)
let yaml.parse (config :
{
general: {
engine_id: string,
socket_dir: string,
log_dir: string,
log_level: string,
liquidsoap_as_root: string,
liquidsoap_min_version: string,
api_url_playlog: string
},
telnet: {
server_enable: string,
server_timeout: string,
server_host: string,
server_port: string
},
fallback: {
music_folder: string,
show_name: string,
show_id: string,
type: string,
music_playlist: string,
music_folder_reload: string,
max_blank: string,
min_noise: string,
threshold: string
},
stream: [
{
enabled: bool,
encoding: string,
bitrate: string,
channels: string,
host: string,
port: float,
mountpoint: string,
user: string,
password: string,
url: string,
name: string,
genre: string,
description: string
}
],
audio: {
soundsystem: string,
devices: {output: [{name: string}], input: [{name: string}]}
}
}
) = file.contents(config_file)
ini
engine_config_folder = string.split(separator="/engine-core.yaml", config_file)
engine_config_folder = list.nth(default="../config/", engine_config_folder, 0)
print(
"\tengine_config_folder = '#{engine_config_folder}'"
......
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