The whole get_plugin/.status() block should be under try/except

This commit is contained in:
Fabio Manganiello 2021-02-03 17:44:40 +01:00
parent 673351db51
commit 346bd9602d

View file

@ -67,10 +67,10 @@ class MediaCtrlPlugin(Plugin):
if configured_media_plugins:
try:
plugin = get_plugin(configured_media_plugins[0])
except:
pass
status = plugin.status().output
except:
continue
if status.get('state') == PlayerState.PLAY.value or status.get('state') == PlayerState.PAUSE.value:
return plugin