Wrapped MPD plugin reload logic to prevent the backend from crashing if the second initialization fails as well

This commit is contained in:
Fabio Manganiello 2018-10-21 14:50:58 +02:00
parent ae7cd120d2
commit fec684210c

View file

@ -62,7 +62,11 @@ class MusicMpdBackend(Backend):
except Exception as e:
self.logger.exception(e)
self.logger.info('Reloading crashed MPD plugin')
try:
plugin = get_plugin('music.mpd', reload=True)
except:
pass
time.sleep(self.poll_seconds)
if state != last_state: