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
def append_title(m) =
log("Using stream_format #{!stream_metadata_type}")
if !stream_metadata_type == 1 then
[("title", "#{!show_name} - #{m['artist']} - #{m['title']}")]
elsif !stream_metadata_type == 2 then
[("title", "#{!station_name} - #{!show_name}")]
if list.mem_assoc("mapped", m) then
#protection against applying this function twice. It shouldn't be happening
#and bug file with Liquidsoap.
m
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

View File

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