From ff616f3a0ad1b42db599052ed37d613f4c3b6959 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 24 Oct 2010 20:49:57 +0200 Subject: [PATCH] 'playid "-1"' now resumes playback if paused --- docs/changes.rst | 1 + mopidy/frontends/mpd/protocol/playback.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/changes.rst b/docs/changes.rst index ed05050c..2ff8c982 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -43,6 +43,7 @@ No description yet. :issue:`24`, contributes to :issue:`14`) - Improved handling of uncaught exceptions in threads. The entire process should now exit immediately. +- MPD command ``playid "-1"`` now correctly resumes playback if paused. 0.1.0 (2010-08-23) diff --git a/mopidy/frontends/mpd/protocol/playback.py b/mopidy/frontends/mpd/protocol/playback.py index c3fbdd5f..2f5dd29e 100644 --- a/mopidy/frontends/mpd/protocol/playback.py +++ b/mopidy/frontends/mpd/protocol/playback.py @@ -138,6 +138,10 @@ def playid(frontend, cpid): at the first track. """ cpid = int(cpid) + paused = (frontend.backend.playback.state == + frontend.backend.playback.PAUSED) + if cpid == -1 and paused: + return frontend.backend.playback.resume() try: if cpid == -1: cp_track = _get_cp_track_for_play_minus_one(frontend)