[vlc-commits] lua: icecast: show url as alternative for unknown stations
Francois Cartegnie
git at videolan.org
Tue May 22 17:52:01 CEST 2012
vlc/vlc-2.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 8 12:29:26 2012 +0200| [74cedadc0ad778ccb44dc8bca138c3992a7bf2f3] | committer: Jean-Baptiste Kempf
lua: icecast: show url as alternative for unknown stations
(cherry picked from commit 37fa606c9185246358d7a55184c28aa480523436)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=74cedadc0ad778ccb44dc8bca138c3992a7bf2f3
---
share/lua/sd/icecast.lua | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/share/lua/sd/icecast.lua b/share/lua/sd/icecast.lua
index 764c127..8540a08 100644
--- a/share/lua/sd/icecast.lua
+++ b/share/lua/sd/icecast.lua
@@ -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];
More information about the vlc-commits
mailing list