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:
parent
8f3c4b7c6f
commit
5a735aa625
|
@ -24,7 +24,6 @@ def open_xml(file):
|
||||||
|
|
||||||
def open_music(file):
|
def open_music(file):
|
||||||
try:
|
try:
|
||||||
libsaria.sources.cur_id = None
|
|
||||||
libsaria.controls.load(file)
|
libsaria.controls.load(file)
|
||||||
libsaria.controls.play()
|
libsaria.controls.play()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
|
@ -41,10 +41,12 @@ get_attrs_id = library.get_attrs
|
||||||
|
|
||||||
def get_attrs(*attrs):
|
def get_attrs(*attrs):
|
||||||
# I should probably get a lock here...
|
# I should probably get a lock here...
|
||||||
|
global cur_id
|
||||||
res = None
|
res = None
|
||||||
if cur_id:
|
if cur_id:
|
||||||
res = get_attrs_id(cur_id, *attrs)
|
res = get_attrs_id(cur_id, *attrs)
|
||||||
if res == None:
|
if res == None:
|
||||||
|
cur_id = None
|
||||||
file = libsaria.audio.get_cur_file()
|
file = libsaria.audio.get_cur_file()
|
||||||
res = find_attrs(file, *attrs)
|
res = find_attrs(file, *attrs)
|
||||||
if res == None:
|
if res == None:
|
||||||
|
|
Loading…
Reference in New Issue