From cf8415d2286731af939cd0585db5582e2e5f6d00 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Wed, 19 Oct 2016 13:34:57 -0200 Subject: [PATCH] Added 'stopped' to status And make sure that the status exist so we don't show an error to the user. --- i3pystatus/spotify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/i3pystatus/spotify.py b/i3pystatus/spotify.py index 1692dfb..ff6b5ee 100644 --- a/i3pystatus/spotify.py +++ b/i3pystatus/spotify.py @@ -13,7 +13,7 @@ class Spotify(IntervalModule): .. rubric:: Available formatters - * `{status}` — current status icon (paused/playing) + * `{status}` — current status icon (paused/playing/stopped) * `{length}` — total song duration (mm:ss format) * `{artist}` — artist * `{title}` — title @@ -39,6 +39,7 @@ class Spotify(IntervalModule): status = { 'paused': '▷', 'playing': '▶', + 'stopped': '■', } player_name = None @@ -69,7 +70,8 @@ class Spotify(IntervalModule): # returns a dictionary of all player data return { - "status": self.status[status.lower()] if status else None, + "status": self.status[status.lower()] + if status in self.status.keys() else "", "title": title if title else "", "album": album if album else "", "artist": artist if artist else "",