From 88359db48d0c4f98df53493b8c09c24886156874 Mon Sep 17 00:00:00 2001 From: Akash Mehrotra Date: Thu, 30 Jun 2011 23:47:27 +0530 Subject: [PATCH] luahttp: implement pl_delete to match oldhttp feature THIS IS TOTALLY UNSUPPORTED. Signed-off-by: Jean-Baptiste Kempf --- modules/lua/libs/playlist.c | 13 ++++++++++++- share/lua/http/requests/README.txt | 5 +++-- share/lua/http/requests/status.xml | 3 +-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c index df0f15c2b0..ae610f3060 100644 --- a/modules/lua/libs/playlist.c +++ b/modules/lua/libs/playlist.c @@ -1,7 +1,7 @@ /***************************************************************************** * playlist.c ***************************************************************************** - * Copyright (C) 2007-2008 the VideoLAN team + * Copyright (C) 2007-2011 the VideoLAN team * $Id$ * * Authors: Antoine Cellerier @@ -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 } }; diff --git a/share/lua/http/requests/README.txt b/share/lua/http/requests/README.txt index a367adcff5..b12a9892c9 100644 --- a/share/lua/http/requests/README.txt +++ b/share/lua/http/requests/README.txt @@ -46,6 +46,7 @@ status.xml: > delete item from playlist: ?command=pl_delete&id= + NOTA BENE: pl_delete is completly UNSUPPORTED > empty playlist: ?command=pl_empty @@ -127,11 +128,11 @@ vlm_cmd.xml: equalizer.xml: ============= ->command=preamp&val= +>command=preamp&val= sets the preamp value, must be >=-20 and <=20 >command=equalizer&band=&val==-20 and <=20)