CC-5229: map_metadata in Liquidsoap is applied twice

fixed
This commit is contained in:
Martin Konecny 2013-06-12 16:04:57 -04:00
parent 6961ba0a00
commit fb80530069
2 changed files with 13 additions and 8 deletions

View File

@ -23,12 +23,19 @@ end
# A function applied to each metadata chunk # A function applied to each metadata chunk
def append_title(m) = def append_title(m) =
log("Using stream_format #{!stream_metadata_type}") log("Using stream_format #{!stream_metadata_type}")
if !stream_metadata_type == 1 then
[("title", "#{!show_name} - #{m['artist']} - #{m['title']}")] if list.mem_assoc("mapped", m) then
elsif !stream_metadata_type == 2 then #protection against applying this function twice. It shouldn't be happening
[("title", "#{!station_name} - #{!show_name}")] #and bug file with Liquidsoap.
m
else else
[("title", "#{m['artist']} - #{m['title']}")] if !stream_metadata_type == 1 then
[("title", "#{!show_name} - #{m['artist']} - #{m['title']}"), ("mapped", "true")]
elsif !stream_metadata_type == 2 then
[("title", "#{!station_name} - #{!show_name}"), ("mapped", "true")]
else
[("title", "#{m['artist']} - #{m['title']}"), ("mapped", "true")]
end
end end
end end

View File

@ -73,11 +73,9 @@ create_source()
queue = add(!sources, normalize=false) queue = add(!sources, normalize=false)
pair = insert_metadata(queue) pair = insert_metadata(queue)
f = fst(pair) dynamic_metadata_callback := fst(pair)
queue = snd(pair) queue = snd(pair)
dynamic_metadata_callback := f
output.dummy(fallible=true, queue) output.dummy(fallible=true, queue)
http = input.http_restart(id="http") http = input.http_restart(id="http")