Fix send_mpd_cmd
This commit is contained in:
parent
71338cd17f
commit
6166140c12
12
mpdlisten.py
12
mpdlisten.py
|
@ -191,6 +191,7 @@ def update_display(device, currentsong, status):
|
|||
|
||||
|
||||
def send_mpd_cmd(client, cmd:str):
|
||||
idle_states = ['stop', 'pause']
|
||||
if cmd == 'menu':
|
||||
global current_mode
|
||||
current_mode_index = MODES_ORDER.index(current_mode)
|
||||
|
@ -203,11 +204,16 @@ def send_mpd_cmd(client, cmd:str):
|
|||
global static_ui
|
||||
static_ui = generate_static_ui(current_mode)
|
||||
if cmd == 'prev':
|
||||
client.previous()
|
||||
if client.status()['state'] != 'stop':
|
||||
client.previous()
|
||||
elif cmd == 'next':
|
||||
client.next()
|
||||
if client.status()['state'] != 'stop':
|
||||
client.next()
|
||||
elif cmd == 'toggle':
|
||||
client.pause()
|
||||
if client.status()['state'] in idle_states:
|
||||
client.play()
|
||||
else:
|
||||
client.pause()
|
||||
elif cmd == 'stop':
|
||||
client.stop()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue