Restored retry logic in mpd backend

This commit is contained in:
Fabio Manganiello 2019-01-09 22:20:01 +01:00
parent 156e2e8b5a
commit 89ea4798bf

View file

@ -50,6 +50,9 @@ class MusicMpdBackend(Backend):
plugin = None plugin = None
while not self.should_stop(): while not self.should_stop():
success = False
while not success:
try: try:
plugin = get_plugin('music.mpd') plugin = get_plugin('music.mpd')
if not plugin: if not plugin:
@ -62,6 +65,7 @@ class MusicMpdBackend(Backend):
track = plugin.currentsong().output track = plugin.currentsong().output
state = status['state'].lower() state = status['state'].lower()
playlist = status['playlist'] playlist = status['playlist']
success = True
except StopIteration: except StopIteration:
pass pass
except Exception as e: except Exception as e: