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:
Bryan Schumaker 2010-11-17 23:31:02 -05:00
parent 3eff3c6aee
commit 2ab7ace608
1 changed files with 16 additions and 0 deletions

View File

@ -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)