From 70fbbe39446eaba84a30c98b10f9d44c80c15583 Mon Sep 17 00:00:00 2001 From: enkore Date: Wed, 31 Jul 2013 00:19:32 +0200 Subject: [PATCH] Fix for mpd if playlist is consumed --- i3pystatus/mpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py index d97f533..33f7526 100644 --- a/i3pystatus/mpd.py +++ b/i3pystatus/mpd.py @@ -55,7 +55,7 @@ class MPD(IntervalModule): fdict = {} status = self._mpd_command(s, "status") - fdict["pos"] = int(status["song"])+1 + fdict["pos"] = int(status.get("song", 0))+1 fdict["len"] = int(status["playlistlength"]) fdict["status"] = self.status[status["state"]]