Support podcast episodes as Sonos favorites (#25087)

This commit is contained in:
Anders Melchiorsen 2019-07-12 07:08:57 +02:00 committed by GitHub
parent d47905d119
commit 6173d7c8a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -371,9 +371,15 @@ class SonosEntity(MediaPlayerDevice):
def _set_favorites(self):
"""Set available favorites."""
favorites = self.soco.music_library.get_sonos_favorites()
# Exclude favorites that are non-playable due to no linked resources
self._favorites = [f for f in favorites if f.reference.resources]
self._favorites = []
for fav in self.soco.music_library.get_sonos_favorites():
try:
# Exclude non-playable favorites with no linked resources
if fav.reference.resources:
self._favorites.append(fav)
except SoCoException as ex:
# Skip unknown types
_LOGGER.error("Unhandled favorite '%s': %s", fav.title, ex)
def _radio_artwork(self, url):
"""Return the private URL with artwork for a radio stream."""