Run get_plugin at every iteration of the mpd backend in case the plugin lost the connection and has been reloaded

This commit is contained in:
Fabio Manganiello 2018-04-16 09:38:34 +02:00
parent 1a01b336b7
commit 607ec2812c

View file

@ -24,12 +24,12 @@ class MusicMpdBackend(Backend):
def run(self):
super().run()
plugin = get_plugin('music.mpd')
last_state = None
last_track = None
last_playlist = None
while not self.should_stop():
plugin = get_plugin('music.mpd')
status = plugin.status().output
track = plugin.currentsong().output
state = status['state'].lower()