[media.chromecast] Skip errors on cast.wait.

It may be that the cast thread has been recycled and it's already been
awaited. It's safe to skip the error in these cases.
This commit is contained in:
Fabio Manganiello 2023-11-12 15:52:31 +01:00
parent e416a70658
commit 724f625963
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -165,7 +165,12 @@ class MediaChromecastPlugin(MediaPlugin, RunnablePlugin):
raise RuntimeError(f'Device {chromecast} not found') raise RuntimeError(f'Device {chromecast} not found')
cast = self.chromecasts[chromecast] cast = self.chromecasts[chromecast]
cast.wait()
try:
cast.wait()
except Exception as e:
self.logger.warning('Failed to wait Chromecast sync: %s', e)
return cast return cast
@action @action