From: Jean-Francois M. <je...@ra...> - 2010-01-28 17:43:26
|
Thanks On 28 Jan 2010, at 18:16, David Baelde wrote: > On Thu, Jan 28, 2010 at 10:37 AM, Jean-Francois Mauguit > <je...@ra...> wrote: >> What are the other meta available in liquidsoap : album ? other ones ? > > Off the top of my head, there's "song". Liquidsoap does not have any > limitation on what you can get, it only depends on the input source. > You can print all metadata using on_metadata() handlers. And (this is > probably already your plan) use map_metadata() to transform the > incoming metadata to an uniform setup, erasing the dependency on the > source client. I tried to implement that, it sounds working (no error) but it was already the case with my software :-) So I did def rewrite_metadata(l,~insert_missing=true,live) def map(m) def apply(x) label = fst(x) meta = snd(x) if list.mem_assoc(label,l) then pattern = l[label] (label,pattern % m) else (label,meta) end end m = list.map(apply,m) def add(m,x) label = fst(x) pattern = snd(x) if not list.mem_assoc(label,m) then list.append(m,[(label,pattern % m)]) else m end end list.fold(add,m,l) end map_metadata(map,insert_missing=insert_missing,live) end live = on_metadata(fun (rewrite_metadata) -> system("curl http://url.com/live.php?string=^quote(meta["title"])^"£"^quote(meta["artist"])^"£"^quote(meta["duration"])^" &"),live) Do you think it will do the trick ? TIA, jef |