libsaria: Clear cur_id correctly

I do this if the song isn't found in the library, rather than as part of
opening a track from disk.
This commit is contained in:
Bryan Schumaker 2011-06-16 18:53:27 -04:00
parent 8f3c4b7c6f
commit 5a735aa625
2 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,6 @@ def open_xml(file):
def open_music(file):
try:
libsaria.sources.cur_id = None
libsaria.controls.load(file)
libsaria.controls.play()
except Exception, e:

View File

@ -41,10 +41,12 @@ get_attrs_id = library.get_attrs
def get_attrs(*attrs):
# I should probably get a lock here...
global cur_id
res = None
if cur_id:
res = get_attrs_id(cur_id, *attrs)
if res == None:
cur_id = None
file = libsaria.audio.get_cur_file()
res = find_attrs(file, *attrs)
if res == None: