mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-18 07:42:09 +00:00
Radio requests
This commit is contained in:
@@ -18,17 +18,25 @@ let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentia
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define playlists to be used in the stream
|
# Define playlists to be used in the stream
|
||||||
s1 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/all_playlist.playlist"))
|
s1 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/all_playlist.playlist"))
|
||||||
s2 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/priority_queue.playlist"))
|
s2 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/priority_queue.playlist"))
|
||||||
s3 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/hit.playlist"))
|
s3 = replaygain(playlist(reload_mode="watch", check_next=check, "/home/pi/Conjurer/hit.playlist"))
|
||||||
requests_queue = request.queue()
|
requests_queue = request.queue()
|
||||||
def queue_processing()
|
def queue_processing()
|
||||||
requests_queue.push.uri("/home/pi/Conjurer/request.playlist")
|
|
||||||
file.remove("/home/pi/Conjurer/requests_queue.playlist")
|
|
||||||
file.touch("/home/pi/Conjurer/requests_queue.playlist")
|
f1=file.read("/home/pi/Conjurer/request.playlist")
|
||||||
|
requests_queue.push.uri(f1())
|
||||||
|
file.remove("/home/pi/Conjurer/request.playlist")
|
||||||
|
f = file.open("/home/pi/Conjurer/request.playlist", create=true)
|
||||||
|
f.close()
|
||||||
|
print("done")
|
||||||
end
|
end
|
||||||
thread.run(every=60., {queue_processing()})
|
thread.run(every=60., queue_processing)
|
||||||
|
|
||||||
# Randomly select a playlist with weights
|
# Randomly select a playlist with weights
|
||||||
s = random(id="randomizer", weights=[1, 3, 2], [s1, s2, s3])
|
s = random(id="randomizer", weights=[1, 3, 2], [s1, s2, s3])
|
||||||
|
|||||||
Reference in New Issue
Block a user