Commit 74cedadc authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

lua: icecast: show url as alternative for unknown stations

(cherry picked from commit 37fa606c9185246358d7a55184c28aa480523436)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d12af091
......@@ -29,8 +29,13 @@ function main()
local tree = simplexml.parse_url("http://dir.xiph.org/yp.xml")
for _, station in ipairs( tree.children ) do
simplexml.add_name_maps( station )
local station_name = station.children_map["server_name"][1].children[1]
if station_name == "Unspecified name" or station_name == ""
then
station_name = station.children_map["listen_url"][1].children[1]
end
vlc.sd.add_item( {path=station.children_map["listen_url"][1].children[1],
title=station.children_map["server_name"][1].children[1],
title=station_name,
genre=station.children_map["genre"][1].children[1],
nowplaying=station.children_map["current_song"][1].children[1],
meta={["Icecast"]={["Bitrate"]=station.children_map["bitrate"][1].children[1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment