libsaria: Correct library num_visible()

Simply return the length of matching songs in the index.
This commit is contained in:
Bryan Schumaker 2011-05-22 09:45:10 -04:00
parent 43f37c93a7
commit bfeeb7f568
2 changed files with 9 additions and 8 deletions

View File

@ -6,11 +6,12 @@ import tree
import index
# Function pointers for conveniance
add_path = library.add_path
get_attrs = library.get_attrs
list_ids = tree.list_ids
filter = index.filter
is_visible = index.is_visible
add_path = library.add_path
get_attrs = library.get_attrs
list_ids = tree.list_ids
filter = index.filter
is_visible = index.is_visible
num_visible = index.num_visible
library.load()
tree.make_tree()
@ -20,9 +21,6 @@ def update_lib():
update.update()
tree.make_tree()
def num_visible():
return library.size()
def reset():
library.reset()
tree.make_tree()

View File

@ -49,6 +49,9 @@ def reindex():
def is_visible(id):
return id in matching
def num_visible():
return len(matching)
def do_filter(terms):
if len(terms) == 0:
return all_ids