Changeset 4bde22b6ed61c8610b140e7392d48c39fd568b94
- 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
| r87c76c2 |
r4bde22b |
|
| 568 | 568 | return 1; |
|---|
| 569 | 569 | } |
|---|
| 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 |
|---|
| 601 | 570 | |
|---|
| 602 | 571 | static int vlclua_playlist_search( lua_State *L ) |
|---|
| … | … | |
| 605 | 574 | const char *psz_string = luaL_optstring( L, 1, "" ); |
|---|
| 606 | 575 | 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 ); |
|---|
| 612 | 580 | vlc_object_release( p_playlist ); |
|---|
| 613 | 581 | return 1; |
|---|
| r2d3320d |
r4bde22b |
|
| 199 | 199 | local playlist |
|---|
| 200 | 200 | local tree = playlist_is_tree(client) |
|---|
| 201 | | print("tree",tree) |
|---|
| 202 | 201 | if name == "search" then |
|---|
| 203 | 202 | playlist = vlc.playlist.search(arg or "", tree) |
|---|
| 204 | 203 | else |
|---|
| 205 | 204 | if tonumber(arg) then |
|---|
| 206 | | print "number" |
|---|
| 207 | 205 | playlist = vlc.playlist.get(tonumber(arg), tree) |
|---|
| 208 | 206 | elseif arg then |
|---|
| 209 | | print "string" |
|---|
| 210 | 207 | playlist = vlc.playlist.get(arg, tree) |
|---|
| 211 | 208 | else |
|---|