Commit 0aa03074 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lua: sd: remove SD item category

Lua has support for sub-item which wholly supersets item category.
None of the scripts ever used the category parameter anyway.
parent 21d61f40
......@@ -329,36 +329,26 @@ static const luaL_Reg vlclua_node_reg[] = {
/*** Services discovery instance ***/
static int vlclua_sd_add_common( services_discovery_t *p_sd, lua_State *L,
static int vlclua_sd_add_common( services_discovery_t *p_sd,
input_item_t *p_input )
{
if( p_input == NULL )
return 1;
lua_getfield( L, -2, "category" );
if( lua_isstring( L, -1 ) )
services_discovery_AddItemCat( p_sd, p_input, luaL_checkstring( L, -1 ) );
else
if( p_input != NULL )
services_discovery_AddItem( p_sd, p_input );
lua_pop( L, 1 );
return 1;
}
static int vlclua_sd_add_item( lua_State *L )
{
services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
input_item_t *p_input = vlclua_sd_create_item( p_sd, L );
return vlclua_sd_add_common( p_sd, L, p_input );
return vlclua_sd_add_common( p_sd, vlclua_sd_create_item( p_sd, L ) );
}
static int vlclua_sd_add_node( lua_State *L )
{
services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
input_item_t *p_input = vlclua_sd_create_node( p_sd, L );
return vlclua_sd_add_common( p_sd, L, p_input );
return vlclua_sd_add_common( p_sd, vlclua_sd_create_node( p_sd, L ) );
}
static int vlclua_sd_remove_item( lua_State *L )
......
......@@ -325,8 +325,7 @@ sd.add_node( ... ): Add a node to the service discovery.
.arturl: the node's ArtURL (OPTIONAL)
.category: the node's category (OPTIONAL)
sd.add_item( ... ): Add an item to the service discovery.
The item object has the same members as the one in playlist.add() along with:
.category: the item's category (OPTIONAL)
The item object has the same members as the one in playlist.add().
Returns the input item.
sd.remove_item( item ): remove the item.
......
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