diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index a044edc7c..e2123e26d 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -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 diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index 4d6318529..36d85a372 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -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")