CC-5226:
Metadata isn't correct during playing -should be fixed
This commit is contained in:
parent
21c84dcaad
commit
0e560d89ad
|
@ -1,10 +1,14 @@
|
||||||
def notify(m)
|
def notify(m)
|
||||||
#current_media_id := string_of(m['schedule_table_id'])
|
|
||||||
command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --media-id=#{m['schedule_table_id']} &"
|
command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --media-id=#{m['schedule_table_id']} &"
|
||||||
log(command)
|
log(command)
|
||||||
system(command)
|
system(command)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def notify_queue(m)
|
||||||
|
queue_metadata := m
|
||||||
|
notify(m)
|
||||||
|
end
|
||||||
|
|
||||||
def notify_stream(m)
|
def notify_stream(m)
|
||||||
json_str = string.replace(pattern="\n",(fun (s) -> ""), json_of(m))
|
json_str = string.replace(pattern="\n",(fun (s) -> ""), json_of(m))
|
||||||
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
|
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
|
||||||
|
@ -27,6 +31,10 @@ def append_title(m) =
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def queue_metadata_callback(m) =
|
||||||
|
append_title(!queue_metadata)
|
||||||
|
end
|
||||||
|
|
||||||
def crossfade_airtime(s)
|
def crossfade_airtime(s)
|
||||||
#duration is automatically overwritten by metadata fields passed in
|
#duration is automatically overwritten by metadata fields passed in
|
||||||
#with audio
|
#with audio
|
||||||
|
|
|
@ -24,6 +24,8 @@ default_dj_fade = ref 0.
|
||||||
station_name = ref ''
|
station_name = ref ''
|
||||||
show_name = ref ''
|
show_name = ref ''
|
||||||
|
|
||||||
|
queue_metadata = ref []
|
||||||
|
|
||||||
s1_connected = ref ''
|
s1_connected = ref ''
|
||||||
s2_connected = ref ''
|
s2_connected = ref ''
|
||||||
s3_connected = ref ''
|
s3_connected = ref ''
|
||||||
|
@ -47,7 +49,7 @@ def create_source()
|
||||||
# the crossfade function controls fade in/out
|
# the crossfade function controls fade in/out
|
||||||
l = crossfade_airtime(l)
|
l = crossfade_airtime(l)
|
||||||
|
|
||||||
l = on_metadata(notify, l)
|
l = on_metadata(notify_queue, l)
|
||||||
sources := list.append([l], !sources)
|
sources := list.append([l], !sources)
|
||||||
server.register(namespace="queues",
|
server.register(namespace="queues",
|
||||||
"s#{!source_id}_skip",
|
"s#{!source_id}_skip",
|
||||||
|
@ -70,6 +72,8 @@ create_source()
|
||||||
|
|
||||||
queue = add(!sources, normalize=false)
|
queue = add(!sources, normalize=false)
|
||||||
|
|
||||||
|
queue = map_metadata(update=false, queue_metadata_callback, queue)
|
||||||
|
|
||||||
output.dummy(fallible=true, queue)
|
output.dummy(fallible=true, queue)
|
||||||
|
|
||||||
http = input.http_restart(id="http")
|
http = input.http_restart(id="http")
|
||||||
|
|
Loading…
Reference in New Issue