libsaria: Fix playing songs from outside of library
The song was loading, but attributes weren't updating. I also use this patch to begin playback when a song is loaded (I was tired of manually pressing play every time)
This commit is contained in:
parent
63574a17c6
commit
e0ad57c541
|
@ -24,7 +24,9 @@ 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()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ cur_id = None
|
||||||
def inc_count():
|
def inc_count():
|
||||||
attrs.inc_count(get_attrs("id")[0])
|
attrs.inc_count(get_attrs("id")[0])
|
||||||
|
|
||||||
def find_attrs(file, *attrs):
|
def find_attrs(file, *attr_list):
|
||||||
if file == None:
|
if file == None:
|
||||||
return
|
return
|
||||||
track = library.track.Track(file)
|
track = library.track.Track(file)
|
||||||
|
@ -25,7 +25,7 @@ def find_attrs(file, *attrs):
|
||||||
id = library.update.song_id(file)
|
id = library.update.song_id(file)
|
||||||
get = track.__dict__.get
|
get = track.__dict__.get
|
||||||
res = []
|
res = []
|
||||||
for attr in attrs:
|
for attr in attr_list:
|
||||||
if attr == "id":
|
if attr == "id":
|
||||||
res.append(id)
|
res.append(id)
|
||||||
elif attr == "like":
|
elif attr == "like":
|
||||||
|
|
Loading…
Reference in New Issue