libsaria: Test song visibility through sources

It queries the library, but the playlist and the queue should be able to
use this too.  Then they don't each need to track what is currently
visible.
This commit is contained in:
Bryan Schumaker 2011-05-21 22:05:23 -04:00
parent f676b5b44d
commit eea3118012
3 changed files with 15 additions and 3 deletions

View File

@ -41,6 +41,9 @@ def get_attrs(*attrs):
return library.get_attrs(cur_id, *attrs)
return -1
def is_visible(id):
return library.is_visible(id)
def set_attr(attr, value):
if cur_source:
cur_source.set_attr(cur_id, attr, value)

View File

@ -6,9 +6,11 @@ import tree
import index
# Function pointers for conveniance
add_path = library.add_path
get_attrs = library.get_attrs
list_ids = tree.list_ids
add_path = library.add_path
get_attrs = library.get_attrs
list_ids = tree.list_ids
filter = index.filter
is_visible = index.is_visible
library.load()
tree.make_tree()

View File

@ -5,6 +5,7 @@ import library
lib_index = dict()
all_ids = set()
matching = set()
space_ord = ord(" ")
stripc = u"\"#$%&'*+<=>@[]^`{|}~.?!"
@ -40,3 +41,9 @@ def add_tracks(tracks):
def reindex():
for src, tracks in library.lib_dict.iteritems():
add_tracks(tracks)
def is_visible(id):
return id in matching
def filter(text):
print text