]> git.sesse.net Git - vlc/commitdiff
Lua SD: use "path" instead of "url"
authorFabio Ritrovato <sephiroth87@videolan.org>
Sat, 20 Feb 2010 14:13:03 +0000 (15:13 +0100)
committerFabio Ritrovato <sephiroth87@videolan.org>
Sat, 20 Feb 2010 14:53:58 +0000 (15:53 +0100)
modules/misc/lua/libs/sd.c
share/lua/sd/fmc.lua
share/lua/sd/freebox.lua
share/lua/sd/frenchtv.lua

index 5515cd014b7c0cb43a628f63cdfeee392f9d75a8..46ff868de7a161ede11e61d3b1c041d614a64b67 100644 (file)
@@ -156,19 +156,19 @@ static int vlclua_sd_add_item( lua_State *L )
     services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
     if( lua_istable( L, -1 ) )
     {
-        lua_getfield( L, -1, "url" );
+        lua_getfield( L, -1, "path" );
         if( lua_isstring( L, -1 ) )
         {
             char **ppsz_options = NULL;
             int i_options = 0;
-            char *psz_url = strdup( lua_tostring( L, -1 ) );
+            char *psz_path = strdup( lua_tostring( L, -1 ) );
             lua_pop( L, 1 );
             vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
-            input_item_t *p_input = input_item_NewExt( p_sd, psz_url, psz_url,
+            input_item_t *p_input = input_item_NewExt( p_sd, psz_path, psz_path,
                                                        i_options,
                                                        (const char **)ppsz_options,
                                                        VLC_INPUT_OPTION_TRUSTED, -1 );
-            free( psz_url );
+            free( psz_path );
             vlclua_read_meta_data( p_sd, L, p_input );
             /* This one is to be tested... */
             vlclua_read_custom_meta_data( p_sd, L, p_input );
@@ -191,7 +191,7 @@ static int vlclua_sd_add_item( lua_State *L )
             lua_setmetatable( L, -2 );
         }
         else
-            msg_Err( p_sd, "vlc.sd.add_item: the \"url\" parameter can't be empty" );
+            msg_Err( p_sd, "vlc.sd.add_item: the \"path\" parameter can't be empty" );
     }
     else
         msg_Err( p_sd, "Error parsing add_item arguments" );
@@ -220,20 +220,20 @@ static int vlclua_node_add_subitem( lua_State *L )
     {
         if( lua_istable( L, -1 ) )
         {
-            lua_getfield( L, -1, "url" );
+            lua_getfield( L, -1, "path" );
             if( lua_isstring( L, -1 ) )
             {
                 char **ppsz_options = NULL;
                 int i_options = 0;
-                char *url = strdup( lua_tostring( L, -1 ) );
+                char *psz_path = strdup( lua_tostring( L, -1 ) );
                 lua_pop( L, 1 );
                 vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
                 input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
-                input_item_t *p_input = input_item_NewExt( p_sd, url, url,
-                                                           i_options,
+                input_item_t *p_input = input_item_NewExt( p_sd, psz_path,
+                                                           psz_path, i_options,
                                                            (const char **)ppsz_options,
                                                            VLC_INPUT_OPTION_TRUSTED, -1 );
-                free( url );
+                free( psz_path );
                 vlclua_read_meta_data( p_sd, L, p_input );
                 /* This one is to be tested... */
                 vlclua_read_custom_meta_data( p_sd, L, p_input );
@@ -256,7 +256,7 @@ static int vlclua_node_add_subitem( lua_State *L )
                 lua_setmetatable( L, -2 );
             }
             else
-                msg_Err( p_sd, "node:add_subitem: the \"url\" parameter can't be empty" );
+                msg_Err( p_sd, "node:add_subitem: the \"path\" parameter can't be empty" );
         }
         else
             msg_Err( p_sd, "Error parsing add_subitem arguments" );
index e7ae57f2866cc925f62506d1c57a2be7746328d7..98ebf75f63e03fcaaadbf0759c723aa824721912 100644 (file)
@@ -46,10 +46,10 @@ function main()
                 else
                     votes = "Votes: N/A"
                 end
-                songs_node:add_subitem( {url=song_node.children_map["url"][1].children[1],title=title,artist=artist,description=rank .. ", " .. votes} )
+                songs_node:add_subitem( {path=song_node.children_map["url"][1].children[1],title=title,artist=artist,description=rank .. ", " .. votes} )
             end
         end
-        node:add_subitem( {title=show_node.children_map["date"][1].children[1] .. " MP3 Podcast",url=show_node.children_map["podcastmp3"][1].children[1]} )
-        node:add_subitem( {title=show_node.children_map["date"][1].children[1] .. " OGG Podcast",url=show_node.children_map["podcastogg"][1].children[1]} )
+        node:add_subitem( {title=show_node.children_map["date"][1].children[1] .. " MP3 Podcast",path=show_node.children_map["podcastmp3"][1].children[1]} )
+        node:add_subitem( {title=show_node.children_map["date"][1].children[1] .. " OGG Podcast",path=show_node.children_map["podcastogg"][1].children[1]} )
     end
 end
index 849217ac54c72e349030b72df6e4238bcc746bb0..50fb99bda054be1db99455306785cab7bfb596fd 100644 (file)
@@ -40,7 +40,7 @@ function main()
             _, _, option = string.find( line, ":(.+)" )
             table.insert( options, option )
         else
-            vlc.sd.add_item( {url=line,duration=duration,artist=artist,title=name,options=options} )
+            vlc.sd.add_item( {path=line,duration=duration,artist=artist,title=name,options=options} )
             duration = nil
             artist = nil
             name = nil
index bda07b1569d0d606aeded26664e2613ec6fa6a00..71013efee1e3433bda447c37213b9c9c9d9231c2 100644 (file)
@@ -26,7 +26,7 @@ end
 
 function main()
     node = vlc.sd.add_node( {title="Canal +"} )
-    node:add_subitem( {title="Le SAV des émissions ",url="http://www.canalplus.fr/index.php?pid=1782",options={"http-forward-cookies"}} )
-    node:add_subitem( {title="Les Guignols",url="http://www.canalplus.fr/index.php?pid=1784",options={"http-forward-cookies"}} )
-    node:add_subitem( {title="La Météo de Pauline Lefevre",url="http://www.canalplus.fr/index.php?pid=2834",options={"http-forward-cookies"}} )
+    node:add_subitem( {title="Le SAV des émissions ",path="http://www.canalplus.fr/index.php?pid=1782",options={"http-forward-cookies"}} )
+    node:add_subitem( {title="Les Guignols",path="http://www.canalplus.fr/index.php?pid=1784",options={"http-forward-cookies"}} )
+    node:add_subitem( {title="La Météo de Pauline Lefevre",path="http://www.canalplus.fr/index.php?pid=2834",options={"http-forward-cookies"}} )
 end