Add guard for Sonos S1 radio show compatibility (#70251)

This commit is contained in:
jjlawren 2022-04-19 01:56:03 -05:00 committed by GitHub
parent 16c6d79265
commit c29a5dc3fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,7 +172,8 @@ class SonosMedia:
if et_uri_md:
self.channel = et_uri_md.title
if ct_md and ct_md.radio_show:
# Extra guards for S1 compatibility
if ct_md and hasattr(ct_md, "radio_show") and ct_md.radio_show:
radio_show = ct_md.radio_show.split(",")[0]
self.channel = "".join(filter(None, [self.channel, radio_show]))