Get artist and album lists from the library

This patch makes it easy to get an artist or album list out of the
library.
This commit is contained in:
Bryan Schumaker 2010-11-16 23:03:01 -05:00
parent 36cf384cf2
commit 5118829e78
1 changed files with 17 additions and 0 deletions

View File

@ -71,6 +71,23 @@ def walk():
def file_to_id(file):
return os.stat(file).st_ino
def artists():
keys = tag_tree.keys()
keys.sort()
res = []
for key in keys:
res.append( (tag_tree[key].value, key) )
return res
def albums(artist):
art = tag_tree[artist]
keys = art.keys()
keys.sort()
res = []
for key in keys:
res.append( (art[key].value, key) )
return res
def get_attrs(id, *attrs):
res = []
rec = tracks.get(id, None)