From 4b6a6a68c962b187bee0c8206c90ea9de5d1add0 Mon Sep 17 00:00:00 2001 From: lasers Date: Sun, 24 Mar 2019 01:36:31 -0500 Subject: [PATCH] mpd: use empty dict on stopped playback state (#721) --- i3pystatus/mpd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py index 3f64fdd..219b145 100644 --- a/i3pystatus/mpd.py +++ b/i3pystatus/mpd.py @@ -133,7 +133,10 @@ cleartext to the server.)"), try: status = self._mpd_command(self.s, "status") playback_state = status["state"] - currentsong = self._mpd_command(self.s, "currentsong") + if playback_state == "stop": + currentsong = {} + else: + currentsong = self._mpd_command(self.s, "currentsong") except Exception: if self.hide_inactive: self.output = {