Lots of small additions

This commit is contained in:
root
2018-11-02 23:59:32 +00:00
parent d3520d8ebb
commit ef02fecaa8
4 changed files with 264 additions and 3 deletions

View File

@@ -37,18 +37,20 @@ live = audio_to_stereo(
normal_songs = playlist(reload=600, mime_type="application/x-mpegURL", "http://web/playlist.php")
halloween = playlist("/playlists/events/Halloween.m3u")
christmas = playlist("/playlists/events/Chrsitmas.m3u")
requests = audio_to_stereo(drop_video(request.queue(id="request")))
jingles = playlist("/jingles")
def is_halloween() =
def is_date(startd, startm, endd, endm)
localtime(time(), fun (~sec,~min,~hour,~mday,~mon,~year,~wday,~yday,~isdst) ->
mday >= 22 and mon == 10-1 and mday <=31) # These are POSIX standards, mon: month of year [0,11]
mday >= startd and mon == startm-1 and mday <= endd and mon <= endm-1) # These are POSIX standards, mon: month of year [0,11]
end
default = switch([
({is_halloween()}, random(weights = [1,5], [halloween, normal_songs])),
({is_date(22, 10, 31, 10)}, random(weights = [1,5], [halloween, normal_songs])),
({is_date(1, 12, 28, 12)}, random(weights = [1,5], [christmas, normal_songs])),
({true}, normal_songs)
])