mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Adjust Sonos for updated Spotify media browsing (#66508)
This commit is contained in:
parent
09e59e5887
commit
5be5a014f3
@ -105,9 +105,6 @@ async def async_browse_media(
|
|||||||
hass, media_content_type, media_content_id, can_play_artist=False
|
hass, media_content_type, media_content_id, can_play_artist=False
|
||||||
)
|
)
|
||||||
|
|
||||||
if media_content_type == "spotify":
|
|
||||||
return await spotify.async_browse_media(hass, None, None, can_play_artist=False)
|
|
||||||
|
|
||||||
if media_content_type == "library":
|
if media_content_type == "library":
|
||||||
return await hass.async_add_executor_job(
|
return await hass.async_add_executor_job(
|
||||||
library_payload,
|
library_payload,
|
||||||
@ -303,17 +300,8 @@ async def root_payload(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if "spotify" in hass.config.components:
|
if "spotify" in hass.config.components:
|
||||||
children.append(
|
result = await spotify.async_browse_media(hass, None, None)
|
||||||
BrowseMedia(
|
children.extend(result.children)
|
||||||
title="Spotify",
|
|
||||||
media_class=MEDIA_CLASS_APP,
|
|
||||||
media_content_id="",
|
|
||||||
media_content_type="spotify",
|
|
||||||
thumbnail="https://brands.home-assistant.io/_/spotify/logo.png",
|
|
||||||
can_play=False,
|
|
||||||
can_expand=True,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
item = await media_source.async_browse_media(
|
item = await media_source.async_browse_media(
|
||||||
|
@ -522,6 +522,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
"""
|
"""
|
||||||
if spotify.is_spotify_media_type(media_type):
|
if spotify.is_spotify_media_type(media_type):
|
||||||
media_type = spotify.resolve_spotify_media_type(media_type)
|
media_type = spotify.resolve_spotify_media_type(media_type)
|
||||||
|
media_id = spotify.spotify_uri_from_media_browser_url(media_id)
|
||||||
|
|
||||||
if media_source.is_media_source_id(media_id):
|
if media_source.is_media_source_id(media_id):
|
||||||
media_type = MEDIA_TYPE_MUSIC
|
media_type = MEDIA_TYPE_MUSIC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user