Changeset 4bde22b6ed61c8610b140e7392d48c39fd568b94

Show
Ignore:
Timestamp:
11/12/07 23:27:00 (10 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1194906420 +0000
git-parent:

[2d3320dc962cca52a0388c0b3ff4c470e8ac830e]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1194906420 +0000
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/lua/intf.c

    r87c76c2 r4bde22b  
    568568    return 1; 
    569569} 
    570 #if 0 
    571     int s; 
    572     lua_createtable( L, 0, 2 + p_playlist->i_sds ); 
    573     for( s = -2; s < p_playlist->i_sds; s++ ) 
    574     { 
    575         playlist_item_t *p_root; 
    576         switch( s ) 
    577         { 
    578             case -2: 
    579                 /* local/normal playlist */ 
    580                 lua_pushstring( L, "local" ); 
    581                 p_root = p_playlist->p_local_onelevel; 
    582                 break; 
    583             case -1: 
    584                 /* media library */ 
    585                 lua_pushstring( L, "ml" ); 
    586                 p_root = p_playlist->p_ml_onelevel; 
    587                 break; 
    588             default: 
    589                 lua_pushstring( L, p_playlist->pp_sds[s]->p_sd->psz_module ); 
    590                 printf("%s\n", p_playlist->pp_sds[s]->p_sd->psz_module ); 
    591                 p_root = p_playlist->pp_sds[s]->p_one; 
    592                 break; 
    593         } 
    594         printf("s = %d\n", s); 
    595         printf("children = %d\n", p_root->i_children ); 
    596         push_playlist_item( L, p_root ); 
    597         lua_settable( L, -3 ); 
    598     } 
    599     printf("done\n"); 
    600 #endif 
    601570 
    602571static int vlclua_playlist_search( lua_State *L ) 
     
    605574    const char *psz_string = luaL_optstring( L, 1, "" ); 
    606575    int b_category = luaL_optboolean( L, 2, 1 ); /* default to category */ 
    607     playlist_LiveSearchUpdate( p_playlist, 
    608                                b_category ? p_playlist->p_root_category 
    609                                           : p_playlist->p_root_onelevel, 
    610                                psz_string ); 
    611     push_playlist_item( L, p_playlist->p_root_category ); 
     576    playlist_item_t *p_item = b_category ? p_playlist->p_root_category 
     577                                         : p_playlist->p_root_onelevel; 
     578    playlist_LiveSearchUpdate( p_playlist, p_item, psz_string ); 
     579    push_playlist_item( L, p_item ); 
    612580    vlc_object_release( p_playlist ); 
    613581    return 1; 
  • share/luaintf/rc.lua

    r2d3320d r4bde22b  
    199199    local playlist 
    200200    local tree = playlist_is_tree(client) 
    201     print("tree",tree) 
    202201    if name == "search" then 
    203202        playlist = vlc.playlist.search(arg or "", tree) 
    204203    else 
    205204        if tonumber(arg) then 
    206             print "number" 
    207205            playlist = vlc.playlist.get(tonumber(arg), tree) 
    208206        elseif arg then 
    209             print "string" 
    210207            playlist = vlc.playlist.get(arg, tree) 
    211208        else