[modules/spotify] fix song not shown issue

the previous commit accidentially removed the song display. re-add that
and also add a bit of logging for troubleshooting.
This commit is contained in:
tobi-wan-kenobi 2020-09-06 14:27:17 +02:00
parent 3a5365a2c3
commit b79c19b616

View file

@ -25,6 +25,8 @@ import core.input
import core.decorators
import util.format
import logging
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, [])
@ -63,8 +65,7 @@ class Module(core.module.Module):
}
widget.set("state", "next")
elif widget_name == "spotify.song":
widget.set("state", "song")
widget.full_text(self.__song)
pass
else:
raise KeyError(
"The spotify module does not have a {widget_name!r} widget".format(
@ -111,8 +112,12 @@ class Module(core.module.Module):
widget.set("state", "playing")
else:
widget.set("state", "paused")
elif widget.name == "spotify.song":
widget.set("state", "song")
widget.full_text(self.__song)
except Exception as e:
logging.exception(e)
self.__song = ""
@property