Commit 3590d1c3 authored by Fabio Ritrovato's avatar Fabio Ritrovato

Lua SD: use "path" instead of "url"

parent bad5a049
...@@ -156,19 +156,19 @@ static int vlclua_sd_add_item( lua_State *L ) ...@@ -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 ); services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
if( lua_istable( L, -1 ) ) if( lua_istable( L, -1 ) )
{ {
lua_getfield( L, -1, "url" ); lua_getfield( L, -1, "path" );
if( lua_isstring( L, -1 ) ) if( lua_isstring( L, -1 ) )
{ {
char **ppsz_options = NULL; char **ppsz_options = NULL;
int i_options = 0; int i_options = 0;
char *psz_url = strdup( lua_tostring( L, -1 ) ); char *psz_path = strdup( lua_tostring( L, -1 ) );
lua_pop( L, 1 ); lua_pop( L, 1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options ); 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, i_options,
(const char **)ppsz_options, (const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 ); VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_url ); free( psz_path );
vlclua_read_meta_data( p_sd, L, p_input ); vlclua_read_meta_data( p_sd, L, p_input );
/* This one is to be tested... */ /* This one is to be tested... */
vlclua_read_custom_meta_data( p_sd, L, p_input ); vlclua_read_custom_meta_data( p_sd, L, p_input );
...@@ -191,7 +191,7 @@ static int vlclua_sd_add_item( lua_State *L ) ...@@ -191,7 +191,7 @@ static int vlclua_sd_add_item( lua_State *L )
lua_setmetatable( L, -2 ); lua_setmetatable( L, -2 );
} }
else 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 else
msg_Err( p_sd, "Error parsing add_item arguments" ); msg_Err( p_sd, "Error parsing add_item arguments" );
...@@ -220,20 +220,20 @@ static int vlclua_node_add_subitem( lua_State *L ) ...@@ -220,20 +220,20 @@ static int vlclua_node_add_subitem( lua_State *L )
{ {
if( lua_istable( L, -1 ) ) if( lua_istable( L, -1 ) )
{ {
lua_getfield( L, -1, "url" ); lua_getfield( L, -1, "path" );
if( lua_isstring( L, -1 ) ) if( lua_isstring( L, -1 ) )
{ {
char **ppsz_options = NULL; char **ppsz_options = NULL;
int i_options = 0; int i_options = 0;
char *url = strdup( lua_tostring( L, -1 ) ); char *psz_path = strdup( lua_tostring( L, -1 ) );
lua_pop( L, 1 ); lua_pop( L, 1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options ); 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_node_t *p_input_node = input_item_node_Create( *pp_node );
input_item_t *p_input = input_item_NewExt( p_sd, url, url, input_item_t *p_input = input_item_NewExt( p_sd, psz_path,
i_options, psz_path, i_options,
(const char **)ppsz_options, (const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 ); VLC_INPUT_OPTION_TRUSTED, -1 );
free( url ); free( psz_path );
vlclua_read_meta_data( p_sd, L, p_input ); vlclua_read_meta_data( p_sd, L, p_input );
/* This one is to be tested... */ /* This one is to be tested... */
vlclua_read_custom_meta_data( p_sd, L, p_input ); vlclua_read_custom_meta_data( p_sd, L, p_input );
...@@ -256,7 +256,7 @@ static int vlclua_node_add_subitem( lua_State *L ) ...@@ -256,7 +256,7 @@ static int vlclua_node_add_subitem( lua_State *L )
lua_setmetatable( L, -2 ); lua_setmetatable( L, -2 );
} }
else 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 else
msg_Err( p_sd, "Error parsing add_subitem arguments" ); msg_Err( p_sd, "Error parsing add_subitem arguments" );
......
...@@ -46,10 +46,10 @@ function main() ...@@ -46,10 +46,10 @@ function main()
else else
votes = "Votes: N/A" votes = "Votes: N/A"
end 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
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] .. " 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",url=show_node.children_map["podcastogg"][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
end end
...@@ -40,7 +40,7 @@ function main() ...@@ -40,7 +40,7 @@ function main()
_, _, option = string.find( line, ":(.+)" ) _, _, option = string.find( line, ":(.+)" )
table.insert( options, option ) table.insert( options, option )
else 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 duration = nil
artist = nil artist = nil
name = nil name = nil
......
...@@ -26,7 +26,7 @@ end ...@@ -26,7 +26,7 @@ end
function main() function main()
node = vlc.sd.add_node( {title="Canal +"} ) 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="Le SAV des émissions ",path="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="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",url="http://www.canalplus.fr/index.php?pid=2834",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 end
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