libsaria: on_like() callback
This replaces the LIKE event for setting if the user likes the current song.
This commit is contained in:
parent
69481ffa70
commit
99771a34fb
|
@ -14,3 +14,7 @@ def pause():
|
|||
on_load = null_cb
|
||||
def load_file(file):
|
||||
on_load(file)
|
||||
|
||||
on_like = null_cb
|
||||
def like_song(like):
|
||||
on_like(like)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import prefs
|
||||
import audio
|
||||
from libsaria import callbacks
|
||||
libsaria = None
|
||||
sources = None
|
||||
library = None
|
||||
|
@ -96,7 +97,8 @@ def set_rand(rand):
|
|||
prefs.set("libsaria.random", rand)
|
||||
|
||||
def set_like(like=None):
|
||||
return call("SETLIKE", sources.set_attr, "like", like)
|
||||
sources.set_attr("like", like)
|
||||
callbacks.like_song(like)
|
||||
|
||||
def get_like():
|
||||
return sources.get_attrs("like")
|
||||
|
|
|
@ -65,5 +65,5 @@ def on_load():
|
|||
tiny.on_load()
|
||||
detailed.on_load()
|
||||
|
||||
def on_like():
|
||||
detailed.nowplaying.on_like()
|
||||
def on_like(like):
|
||||
detailed.nowplaying.on_like(like)
|
||||
|
|
|
@ -62,8 +62,7 @@ def set_art(path):
|
|||
height = 64
|
||||
ARTWORK.set_image(path, height)
|
||||
|
||||
def on_like():
|
||||
like = controls.get_like()
|
||||
def on_like(like):
|
||||
def _on_like1(like):
|
||||
LIKE.set_active(like == True)
|
||||
DISLIKE.set_active(like == False)
|
||||
|
|
|
@ -24,9 +24,9 @@ def on_load(file):
|
|||
body.cur_page_goto()
|
||||
callbacks.on_load = on_load
|
||||
|
||||
def on_like(*args):
|
||||
footer.on_like()
|
||||
invite("POSTSETLIKE", on_like)
|
||||
def on_like(like):
|
||||
footer.on_like(like)
|
||||
callbacks.on_like = on_like
|
||||
|
||||
def on_getart(path, id):
|
||||
cur_id = libsaria.sources.get_attrs("id")
|
||||
|
|
Loading…
Reference in New Issue
Block a user