mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
luahttp: implement pl_delete to match oldhttp feature
THIS IS TOTALLY UNSUPPORTED. Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This commit is contained in:
parent
58df463bd1
commit
88359db48d
@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
* playlist.c
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2007-2008 the VideoLAN team
|
||||
* Copyright (C) 2007-2011 the VideoLAN team
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Antoine Cellerier <dionoea at videolan tod org>
|
||||
@ -138,6 +138,16 @@ static int vlclua_playlist_goto( lua_State * L )
|
||||
return vlclua_push_ret( L, i_ret );
|
||||
}
|
||||
|
||||
static int vlclua_playlist_delete( lua_State * L )
|
||||
{
|
||||
int i_id = luaL_checkint( L, 1 );
|
||||
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
|
||||
PL_LOCK;
|
||||
int i_ret = playlist_DeleteFromInput(p_playlist, playlist_ItemGetById( p_playlist, i_id ) -> p_input, true );
|
||||
PL_UNLOCK;
|
||||
return vlclua_push_ret( L, i_ret );
|
||||
}
|
||||
|
||||
static int vlclua_playlist_add( lua_State *L )
|
||||
{
|
||||
int i_count;
|
||||
@ -378,6 +388,7 @@ static const luaL_Reg vlclua_playlist_reg[] = {
|
||||
{ "current", vlclua_playlist_current },
|
||||
{ "sort", vlclua_playlist_sort },
|
||||
{ "status", vlclua_playlist_status },
|
||||
{ "delete", vlclua_playlist_delete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -46,6 +46,7 @@ status.xml:
|
||||
|
||||
> delete item <id> from playlist:
|
||||
?command=pl_delete&id=<id>
|
||||
NOTA BENE: pl_delete is completly UNSUPPORTED
|
||||
|
||||
> empty playlist:
|
||||
?command=pl_empty
|
||||
|
@ -83,8 +83,7 @@ elseif command == "pl_next" then
|
||||
elseif command == "pl_previous" then
|
||||
vlc.playlist.prev()
|
||||
elseif command == "pl_delete" then
|
||||
vlc.msg.err("FIXME: pl_delete unimplemented")
|
||||
--vlc.playlist.delete(id)
|
||||
vlc.playlist.delete(id)
|
||||
elseif command == "pl_empty" then
|
||||
vlc.playlist.clear()
|
||||
elseif command == "pl_sort" then
|
||||
|
Loading…
Reference in New Issue
Block a user