Hi folks,
I'm running liq 1.3.4.
I need to transmit a file with a dynamic name based on the time.
My script:
[code]
...omissis...
**#Routine for calculate actually Hour**
def cal_ora() =
ora = get_process_output("date +%H")
ors ="/home/videoserver/Scaricati/tm/donna/ora/#{ora}.mp3"
ors = string.replace(pattern="\n",fun (_) -> "",ors)
print(ors)
audio_to_stereo(single(ors))
end
**#Routine for calculate actually Minute**
def cal_min() =
minuti = get_process_output("date +%M")
mis ="/home/videoserver/Scaricati/tm/donna/minuti/#{minuti}.mp3"
mis = string.replace(pattern="\n",fun (_) -> "",mis)
print(mis)
audio_to_stereo(single(mis))
end
**#Routine for Switch calculated time**
def at(pred,s)
switch([(pred,s)])
end
def crossfade(a,b)
add(normalize=false,
[ sequence([ blank(duration=5.),
fade.initial(duration=10.,b) ]),
fade.final(duration=10.,a) ])
end
mattina = playlist(mode='randomize',reload=1,reload_mode="rounds",
"/home/videoserver/Scaricati/bossacover/bossa.m3u")
pomeriggio = playlist(mode='randomize',reload=1,reload_mode="rounds",
"/home/videoserver/Scaricati/bossacover/bossa.m3u")
sera = playlist(mode='randomize',reload=1,reload_mode="rounds",
"/home/videoserver/Scaricati/bossacover/bossa.m3u")
# Schedulazione playlist su fascia oraria
schedule = switch(track_sensitive=false,
[
({20h-8h}, sera),
({8h-12h}, mattina),
({12h-20h}, pomeriggio),
({ true }, sera)
])
s1 = at({10h48-10h54},cal_ora())
s2 = at({10h48-10h54},cal_min())
rotation = rotate(weights=[1,1,1],[s1,s2,schedule])
radio = on_metadata(r_metadata,rotation)
radio = fallback([radio,security])
...omissis...
[/code]
Example:
if the song (sensitive=true) end in this range [10h48-10h54] the system will
have to calculate the exact time --> 10:51 so i can get the file 10.mp3 and
51.mp3
Where i wrong?
actually (with this script) the outputs routine (cal_ora and cal_min) returns
me the time of the script was started.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/641
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users