Commit 522356bd authored by David Trattnig's avatar David Trattnig
Browse files

Provide configuration for station fallbacks. #43

parent ba09c1e7
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
......@@ -39,7 +39,7 @@ heartbeat_port = 43334
# Seconds how often the vitality of the Engine should be checked (0 = disabled)
heartbeat_frequency = 1
logdir="/home/david/Code/aura/engine/logs"
logdir="/home/username/code/aura/engine/logs"
# possible values: debug, info, warning, error, critical
loglevel="info"
......@@ -124,7 +124,7 @@ fade_out_time="2.5"
# all these settings from here to the bottom require a restart of the liquidsoap server
[lqs]
liquidsoap_path="/home/david/.opam/4.08.0/bin/liquidsoap"
liquidsoap_path="/home/username/.opam/4.08.0/bin/liquidsoap"
liquidsoap_working_dir="modules/liquidsoap/"
liquidsoap_as_root="false"
......@@ -137,10 +137,10 @@ daemongroup="engineuser"
daemonuser="engineuser"
[socket]
socketdir="/home/david/Code/aura/engine/modules/liquidsoap"
socketdir="/home/username/code/aura/engine/modules/liquidsoap"
[audiofolder]
audiofolder="/home/david/Code/aura/tank-store"
audiofolder="var/audio/source"
[fallback]
# track_sensitive => fallback_folder track sensitivity
......@@ -150,13 +150,13 @@ audiofolder="/home/david/Code/aura/tank-store"
fallback_max_blank="20."
fallback_min_noise="0."
fallback_threshold="-50."
# a folder holding music for station-fallbacks
fallback_music_folder="/home/david/Music/Genres/beats-breaks-dub-down-hiphop"
fallback_show_name="Random Music"
fallback_show_type="Unmoderated Music"
fallback_show_host="Magic Shuffle"
fallback_title_not_available="Title not available"
# A playlist holding music for Station Fallbacks (optonal)
fallback_music_playlist= "/home/username/code/aura/configuration/playlists/station-fallback-playlist.m3u"
# A folder holding music for Station Fallbacks (optional)
fallback_music_folder="/var/audio/station"
# The time in seconds how often the folder should be re-scanned
# Do not reload to often when using large folders
fallback_music_folder_reload="300"
[soundcard]
......
......@@ -148,13 +148,13 @@ audiofolder="/var/audio/source"
fallback_max_blank="20."
fallback_min_noise="0."
fallback_threshold="-50."
# a folder holding music for station-fallbacks
fallback_music_folder=""
fallback_show_name="Random Music"
fallback_show_type="Unmoderated Music"
fallback_show_host="Magic Shuffle"
fallback_title_not_available="Title not available"
# A playlist holding music for Station Fallbacks (optonal)
fallback_music_playlist= "/home/username/code/aura/configuration/playlists/station-fallback-playlist.m3u"
# A folder holding music for Station Fallbacks (optional)
fallback_music_folder="/var/audio/station"
# The time in seconds how often the folder should be re-scanned
# Do not reload to often when using large folders
fallback_music_folder_reload="300"
[soundcard]
......
......@@ -138,7 +138,7 @@ daemonuser="engineuser"
socketdir="/opt/aura/engine/modules/liquidsoap"
[audiofolder]
audiofolder="/var/audio"
audiofolder="/var/audio/source"
[fallback]
# track_sensitive => fallback_folder track sensitivity
......@@ -148,13 +148,13 @@ audiofolder="/var/audio"
fallback_max_blank="20."
fallback_min_noise="0."
fallback_threshold="-50."
# a folder holding music for station-fallbacks
fallback_music_folder=""
fallback_show_name="Random Music"
fallback_show_type="Unmoderated Music"
fallback_show_host="Magic Shuffle"
fallback_title_not_available="Title not available"
# A playlist holding music for Station Fallbacks (optonal)
fallback_music_playlist= "/home/username/code/aura/configuration/playlists/station-fallback-playlist.m3u"
# A folder holding music for Station Fallbacks (optional)
fallback_music_folder="/var/audio/station"
# The time in seconds how often the folder should be re-scanned
# Do not reload to often when using large folders
fallback_music_folder_reload="300"
[soundcard]
......
......@@ -30,7 +30,7 @@ class AuraConfig:
"""
AuraConfig Class
Holds the Aura Configuration as in the file `engine.ini`.
Holds the Engine Configuration as in the file `engine.ini`.
"""
ini_path = ""
logger = None
......@@ -50,6 +50,7 @@ class AuraConfig:
ini_path = "%s/configuration/engine.ini" % Path(__file__).parent.parent.parent.absolute()
self.ini_path = ini_path
self.set("config_dir", os.path.dirname(ini_path))
self.logger = logging.getLogger("AuraEngine")
self.load_config()
......@@ -135,7 +136,6 @@ class AuraConfig:
# Custom overrides and defaults
self.set("install_dir", os.path.realpath(__file__ + "../../../.."))
self.set("use_test_data", False)
self.set("api_prefix", "/api/v1")
......
......@@ -23,6 +23,8 @@ default_config = "../../configuration/engine.ini"
config = list.hd(default=default_config, get_process_lines("ls /etc/aura/engine.ini"))
log("Config file used: #{config}")
ini = read_ini(config)
engine_config_folder = string.split(separator="/engine.ini", config)
engine_config_folder = list.nth(default="../../configuration/", engine_config_folder, 0)
# ALLOW LIQUIDSOAP RUN AS ROOT
lqs_allow_root = list.assoc(default="false", "liquidsoap_as_root", ini)
......@@ -30,6 +32,9 @@ if lqs_allow_root == "true" then
set("init.allow_root", true)
end
# BASICS
set("console.colorize","always")
# TELNET SETTINGS
set("server.telnet", true)
set("server.telnet.bind_addr", "0.0.0.0")
......@@ -43,7 +48,6 @@ set("log.file.path", "#{log_dir}/engine-lqs.log")
set("server.socket", true)
set("server.socket.path", "./<script>.sock")
#set("request.grace_time",2.)
# SOUND CARD SETTINGS
......@@ -63,12 +67,13 @@ a4_out = list.assoc(default="", "output_device_4", ini)
input_stream_buffer = float_of_string(list.assoc(default="3.0", "input_stream_buffer", ini))
# FALLBACK SETTINGS
fallback_station_playlist_path = "#{engine_config_folder}/playlists/station-fallback-playlist.m3u"
fallback_station_playlist_path = list.assoc(default=fallback_station_playlist_path, "fallback_music_playlist", ini)
fallback_station_dir = list.assoc(default="/var/audio/station", "fallback_music_folder", ini)
fallback_station_dir_reload = int_of_string(list.assoc(default="300", "fallback_music_folder_reload", ini))
fallback_max_blank = float_of_string(list.assoc(default="", "fallback_max_blank", ini))
fallback_min_noise = float_of_string(list.assoc(default="", "fallback_min_noise", ini))
fallback_threshold = float_of_string(list.assoc(default="", "fallback_threshold", ini))
#fallback_max_blank = list.assoc(default="", "fallback_max_blank", ini)
#fallback_min_noise = list.assoc(default="", "fallback_min_noise", ini)
#fallback_threshold = list.assoc(default="", "fallback_threshold", ini)
# FADING SETTINGS
fade_in_time = list.assoc(default="", "fade_in_time", ini) #int_of_string(list.assoc(default="", "fade_in_time", ini))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment