Library set_attr art

I can use the library's set_attr() function to manually set album art
from a local file.
This commit is contained in:
Bryan Schumaker 2010-11-28 00:34:35 -05:00
parent 3a19f6fb07
commit 1c58e948b8

View File

@ -158,7 +158,12 @@ def get_attrs(id, *attrs):
def set_attr(id, attr, new_value):
rec = tracks.get(id, None)
if rec:
rec.__dict__[attr] = new_value
if attr == "art":
from libsaria import lastfm
artist, album = get_attrs(id, "artist", "album")
lastfm.set_artwork_tags(artist, album, new_value)
else:
rec.__dict__[attr] = new_value
def inc_score(id, amount=1):
rec = tracks.get(id, None)