libsaria: Added function for listing the library
This makes it easier for the gui to know what is in the library.
This commit is contained in:
parent
f09f80cd65
commit
083cbf738c
|
@ -8,6 +8,7 @@ import index
|
|||
|
||||
# Function pointers for conveniance
|
||||
add_path = library.add_path
|
||||
list_paths = library.list_paths
|
||||
get_attrs = library.get_attrs
|
||||
all_attrs = library.all_attrs
|
||||
list_ids = tree.list_ids
|
||||
|
|
|
@ -39,6 +39,14 @@ def add_path(path):
|
|||
lib_dict.setdefault(path, dict())
|
||||
unlock_library()
|
||||
|
||||
def list_paths():
|
||||
res = []
|
||||
lock_library()
|
||||
for path, lib in lib_dict.iteritems():
|
||||
res.append((path, lib))
|
||||
unlock_library()
|
||||
return res
|
||||
|
||||
def find_id(id):
|
||||
for src, tracks in lib_dict.iteritems():
|
||||
track = tracks.get(id, None)
|
||||
|
|
Loading…
Reference in New Issue