Identify more Sonos radio stations with poor titles (#33609)

This commit is contained in:
Anders Melchiorsen authored and Paulus Schoutsen committed 2020-04-04 23:52:25 -07:00
1 parent 6a297b3758
commit 5dae7f8451
1 file changed
+4 -4
@@ -614,11 +614,11 @@ class SonosEntity(MediaPlayerDevice):
except (TypeError, KeyError, AttributeError): except (TypeError, KeyError, AttributeError):
pass pass
# Radios without tagging can have the radio URI as title. Non-playing # Radios without tagging can have part of the radio URI as title.
# radios will not have a current title. In these cases we try to use # Non-playing radios will not have a current title. In these cases we
# the radio name instead. # try to use the radio name instead.
try: try:
if self.soco.is_radio_uri(self._media_title) or self.state != STATE_PLAYING: if self._media_title in self._uri or self.state != STATE_PLAYING:
self._media_title = variables["enqueued_transport_uri_meta_data"].title self._media_title = variables["enqueued_transport_uri_meta_data"].title
except (TypeError, KeyError, AttributeError): except (TypeError, KeyError, AttributeError):
pass pass