From 42720a4559c56023b19c67b5d0381228415a6729 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 31 Jan 2021 12:12:19 +0700 Subject: [PATCH] fixed play_next and play_prev if state is pause by removing fade call --- mpd_controller/mpd_playback.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mpd_controller/mpd_playback.py b/mpd_controller/mpd_playback.py index 81543c4..4a1b519 100755 --- a/mpd_controller/mpd_playback.py +++ b/mpd_controller/mpd_playback.py @@ -36,9 +36,12 @@ def play_next(client): """ skip to next in playlist """ client_status = client.status() current_vol = int(client_status['volume']) - fade('out', current_vol, client) - client.pause() - client.setvol(current_vol) + if current_vol > 0: + fade('out', current_vol, client) + client.pause() + client.setvol(current_vol) + else: + client.setvol(100) client.next() @@ -46,7 +49,10 @@ def play_prev(client): """ skip to previous in playlist """ client_status = client.status() current_vol = int(client_status['volume']) - fade('out', current_vol, client) - client.pause() - client.setvol(current_vol) + if current_vol > 0: + fade('out', current_vol, client) + client.pause() + client.setvol(current_vol) + else: + client.setvol(100) client.previous()