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:
parent
36cf384cf2
commit
5118829e78
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue