mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
small fixes
This commit is contained in:
@@ -50,10 +50,10 @@ if platform in ("linux", "linux2"):
|
||||
else:
|
||||
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
|
||||
NETRC_FILE = "/home/pi/.netrc"
|
||||
LOGSTORE = "/home/pi/MediaShare/logs/"
|
||||
LOGSTORE = "/home/pi/MediaFolder/logs/"
|
||||
ENCODING = "utf-8"
|
||||
MUSIC_FOLDER = "/home/pi/MediaShare/mp3/"
|
||||
PRIORITY_FOLDER = "/home/pi/MediaShare/mp3/Magiczne i chuj/"
|
||||
MUSIC_FOLDER = "/home/pi/MediaFolder/mp3/"
|
||||
PRIORITY_FOLDER = "/home/pi/MediaFoldermp3/Magiczne i chuj/"
|
||||
RADIOLOG_PATH = "/home/pi/Conjurer/radio_log.log"
|
||||
PERSISTENCE_PATH = "/home/pi/Conjurer/persistence.log"
|
||||
|
||||
|
||||
@@ -43,6 +43,22 @@ def queue_processing()
|
||||
end
|
||||
end
|
||||
|
||||
# Configure output formats and destinations
|
||||
def now_playing(m)
|
||||
# raw lookup ("" if missing)
|
||||
raw_title = m["title"]
|
||||
raw_artist = m["artist"]
|
||||
|
||||
# default if empty
|
||||
title = if raw_title == "" then "Unknown" else raw_title end
|
||||
artist = if raw_artist == "" then "Unknown" else raw_artist end
|
||||
log.critical("Now playing #{artist} - #{title}")
|
||||
# write it out
|
||||
system("echo '#{artist} - #{title}' > /tmp/now_playing.txt")
|
||||
m
|
||||
end
|
||||
|
||||
|
||||
# Randomly select a playlist with weights
|
||||
s4 = random(id="randomizer", weights=[2, 3, 5], [s1, s2, s3])
|
||||
|
||||
@@ -52,7 +68,8 @@ jingles = (playlist(reload_mode="watch", "/home/pi/Conjurer/jingles.playlist"))
|
||||
# Create the main stream with random playlist and jingles
|
||||
s = rotate(id="randomizer", weights=[10, 1], [s4, jingles])
|
||||
|
||||
s = crossfade(fade_out=2., fade_in=2., duration=4., fallback(id="switcher", track_sensitive=false, [requests_queue, s]))
|
||||
s = crossfade(fade_out=2., fade_in=2., duration=4., fallback(id="switcher", track_sensitive=true, [requests_queue, s]))
|
||||
s = metadata.map(now_playing, s)
|
||||
|
||||
# Set up an interactive harbor for controlling the stream
|
||||
interactive.harbor(port = 9999)
|
||||
@@ -87,7 +104,7 @@ s = blank.skip(max_blank=10., s)
|
||||
live_enabled = interactive.bool("Going Live!", true)
|
||||
|
||||
s = add([mic,s])
|
||||
s=switch(track_sensitive=false,
|
||||
s=switch(track_sensitive=true,
|
||||
[(live_enabled, mic),
|
||||
({true}, s)])
|
||||
|
||||
@@ -102,9 +119,8 @@ set("log.level", loglevel)
|
||||
# Enable logging to file
|
||||
set("log.file", log_to_file)
|
||||
set("log.file.path", logpath)
|
||||
|
||||
# Set up emergency fallback track
|
||||
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
||||
emergency = single("/home/pi/MediaFolder/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
||||
radio = fallback(id="switcher2", track_sensitive=false, [s, emergency])
|
||||
|
||||
# Set up an interactive control for skipping tracks
|
||||
@@ -138,8 +154,7 @@ interactive.persistent("script.params")
|
||||
|
||||
# Configure output formats and destinations
|
||||
|
||||
|
||||
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
||||
output.icecast(%mp3, host="radio", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
||||
output.pulseaudio(radio)
|
||||
#output.file.hls("/tmp/hls", [("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))], radio)
|
||||
# Uncomment the following lines to enable additional output formats
|
||||
|
||||
Reference in New Issue
Block a user