vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Sun May 27 
15:27:08 2012 +0200| [19797936a02e0e7c1188a5798c83d66b8c3d4c68] | committer: 
Francois Cartegnie

lua: icecast: fix indent and add source meta

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19797936a02e0e7c1188a5798c83d66b8c3d4c68
---

 share/lua/sd/icecast.lua |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/share/lua/sd/icecast.lua b/share/lua/sd/icecast.lua
index 35938d0..b23a33c 100644
--- a/share/lua/sd/icecast.lua
+++ b/share/lua/sd/icecast.lua
@@ -29,23 +29,24 @@ 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]
-               if string.find( station_name, "radionomy.com" )
-               then
-                       station_name = string.match( station_name, "([^/]+)$")
-                       station_name = string.gsub( station_name, "-", " " )
-               end
-       end
+        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]
+                if string.find( station_name, "radionomy.com" )
+                then
+                        station_name = string.match( station_name, "([^/]+)$")
+                        station_name = string.gsub( station_name, "-", " " )
+                end
+        end
         vlc.sd.add_item( 
{path=station.children_map["listen_url"][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],
-                                 ["Icecast Server 
Type"]=station.children_map["server_type"][1].children[1]
-                         }} )
+                                  ["Listing Source"]="dir.xiph.org",
+                                  ["Icecast 
Bitrate"]=station.children_map["bitrate"][1].children[1],
+                                  ["Icecast Server 
Type"]=station.children_map["server_type"][1].children[1]
+                          }} )
     end
 end

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to