forked from platypush/platypush
Restored retry logic in mpd backend
This commit is contained in:
parent
156e2e8b5a
commit
89ea4798bf
1 changed files with 20 additions and 16 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue