Categories: Photos

Use metadata from input.harbor to populate now-playing in output.icecast

Since we moved servers for clouwdnine.com, I had some troubles with getting the “Now Playing” text right. Before, this was always populated with the Description or Name our DJs would enter in BUTT. This allowed us to inform visitors of the website to see who was playing, which we liked…

Sadly, I couldn’t find how to fix this, but after way too much time I managed to do this. Just storing it here for people who would like this.


meta = ref []

def update_title(m) =
  me = !meta
# log(json_of(m))
# log(json_of(me))
  if me["title"] != "" then
    title = me["title"]
    [("title","#{title} - LIVE")]
  else
    title = m["title"]
    [("title","#{title} - archive")]
  end
end

def djdisconnects() =
  meta := []
end

def djconnects(h) =
#  log(json_of(h))
  meta := [("title",h["ice-description"])]
end

live = input.harbor("/",port=8000,password="XXXX",icy=true,on_connect=djconnects, on_disconnect=djdisconnects)

radio = map_metadata(update_title,radio)

Share

Recent Posts

Academia and Industry Compared

In the beginning of this year I switched careers. I quit my job as assistant…

December 1, 2021

Aligning Values in AI Applications

Artificial Intelligence (AI) is everywhere. When you use the internet or computers in general you…

September 27, 2021

Why I (think I) Didn’t Succeed in Academia

I’m not too embarrassed to admit that I just finished a 16-session therapy with a…

June 28, 2021

Human-Centric AI Manifesto: Or How To Try and Do No Harm

Introduction Recently I’ve said farewell to my academic career and switched back to industry. While…

June 16, 2021

Surf and the Art of Career Navigation

Disclaimer: I am as good as a surfer as I am experienced a professional. I…

November 30, 2020

Research into Mobility in the Netherlands

Q-Park is probably the biggest owner of parking garages in the Netherlands. Based in Maastricht,…

April 6, 2020