library tag accessor functions
I have created functions to make it easy to get at titles and song ids from known tags.
This commit is contained in:
parent
3eff3c6aee
commit
2ab7ace608
|
@ -88,6 +88,22 @@ def albums(artist):
|
|||
res.append( (art[key].value, key) )
|
||||
return res
|
||||
|
||||
def titles(artist, album):
|
||||
art = tag_tree[artist]
|
||||
alb = art[album]
|
||||
keys = alb.keys()
|
||||
keys.sort()
|
||||
res = []
|
||||
for key in keys:
|
||||
res.append( (alb[key].value, key) )
|
||||
return res
|
||||
|
||||
def song_id(artist, album, title):
|
||||
art = tag_tree[artist]
|
||||
alb = art[album]
|
||||
title = alb[title]
|
||||
return title.keys()[0]
|
||||
|
||||
def get_attrs(id, *attrs):
|
||||
res = []
|
||||
rec = tracks.get(id, None)
|
||||
|
|
Loading…
Reference in New Issue