From: Antoine Cellerier Date: Mon, 12 Nov 2007 22:27:00 +0000 (+0000) Subject: Fix problem with the search lua wrapper (it always returned the "category" playlist... X-Git-Tag: 0.9.0-test0~4614 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4bde22b6ed61c8610b140e7392d48c39fd568b94;p=vlc Fix problem with the search lua wrapper (it always returned the "category" playlist even when searching in "onelevel" mode). Remove debug prints from the rc.lua module. --- diff --git a/modules/misc/lua/intf.c b/modules/misc/lua/intf.c index 88a69f4085..87affad195 100644 --- a/modules/misc/lua/intf.c +++ b/modules/misc/lua/intf.c @@ -567,48 +567,16 @@ static int vlclua_playlist_get( lua_State *L ) vlc_object_release( p_playlist ); return 1; } -#if 0 - int s; - lua_createtable( L, 0, 2 + p_playlist->i_sds ); - for( s = -2; s < p_playlist->i_sds; s++ ) - { - playlist_item_t *p_root; - switch( s ) - { - case -2: - /* local/normal playlist */ - lua_pushstring( L, "local" ); - p_root = p_playlist->p_local_onelevel; - break; - case -1: - /* media library */ - lua_pushstring( L, "ml" ); - p_root = p_playlist->p_ml_onelevel; - break; - default: - lua_pushstring( L, p_playlist->pp_sds[s]->p_sd->psz_module ); - printf("%s\n", p_playlist->pp_sds[s]->p_sd->psz_module ); - p_root = p_playlist->pp_sds[s]->p_one; - break; - } - printf("s = %d\n", s); - printf("children = %d\n", p_root->i_children ); - push_playlist_item( L, p_root ); - lua_settable( L, -3 ); - } - printf("done\n"); -#endif static int vlclua_playlist_search( lua_State *L ) { playlist_t *p_playlist = vlclua_get_playlist_internal( L ); const char *psz_string = luaL_optstring( L, 1, "" ); int b_category = luaL_optboolean( L, 2, 1 ); /* default to category */ - playlist_LiveSearchUpdate( p_playlist, - b_category ? p_playlist->p_root_category - : p_playlist->p_root_onelevel, - psz_string ); - push_playlist_item( L, p_playlist->p_root_category ); + playlist_item_t *p_item = b_category ? p_playlist->p_root_category + : p_playlist->p_root_onelevel; + playlist_LiveSearchUpdate( p_playlist, p_item, psz_string ); + push_playlist_item( L, p_item ); vlc_object_release( p_playlist ); return 1; } diff --git a/share/luaintf/rc.lua b/share/luaintf/rc.lua index a41c968baf..17a62789ec 100644 --- a/share/luaintf/rc.lua +++ b/share/luaintf/rc.lua @@ -198,15 +198,12 @@ function playlist(name,client,arg) end local playlist local tree = playlist_is_tree(client) - print("tree",tree) if name == "search" then playlist = vlc.playlist.search(arg or "", tree) else if tonumber(arg) then - print "number" playlist = vlc.playlist.get(tonumber(arg), tree) elseif arg then - print "string" playlist = vlc.playlist.get(arg, tree) else playlist = vlc.playlist.get(nil, tree)