From 84e438caf4d7dff5c44cc6f779dc9d4703fcbe0e Mon Sep 17 00:00:00 2001 From: ncoop Date: Fri, 15 Apr 2016 20:08:32 -0700 Subject: [PATCH] Ensure currentsong dictionary has "file" key --- i3pystatus/mpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py index 2f3ef4a..17c040a 100644 --- a/i3pystatus/mpd.py +++ b/i3pystatus/mpd.py @@ -114,7 +114,7 @@ class MPD(IntervalModule): "bitrate": int(status.get("bitrate", 0)), } - if not fdict["title"]: + if not fdict["title"] and "file" in currentsong: fdict["filename"] = '.'.join( basename(currentsong["file"]).split('.')[:-1]) else: