Remove Audio Content Restrictions From vlc_telnet (#86821)
This commit is contained in:
parent
b11539fb04
commit
b78318a617
1 changed files with 1 additions and 12 deletions
|
@ -21,7 +21,6 @@ from homeassistant.components.media_player import (
|
|||
from homeassistant.config_entries import SOURCE_HASSIO, ConfigEntry
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -293,14 +292,8 @@ class VlcDevice(MediaPlayerEntity):
|
|||
sourced_media = await media_source.async_resolve_media(
|
||||
self.hass, media_id, self.entity_id
|
||||
)
|
||||
media_type = sourced_media.mime_type
|
||||
media_id = sourced_media.url
|
||||
|
||||
if media_type != MediaType.MUSIC and not media_type.startswith("audio/"):
|
||||
raise HomeAssistantError(
|
||||
f"Invalid media type {media_type}. Only {MediaType.MUSIC} is supported"
|
||||
)
|
||||
|
||||
# If media ID is a relative URL, we serve it from HA.
|
||||
media_id = async_process_play_media_url(
|
||||
self.hass, media_id, for_supervisor_network=self._using_addon
|
||||
|
@ -336,8 +329,4 @@ class VlcDevice(MediaPlayerEntity):
|
|||
media_content_id: str | None = None,
|
||||
) -> BrowseMedia:
|
||||
"""Implement the websocket media browsing helper."""
|
||||
return await media_source.async_browse_media(
|
||||
self.hass,
|
||||
media_content_id,
|
||||
content_filter=lambda item: item.media_content_type.startswith("audio/"),
|
||||
)
|
||||
return await media_source.async_browse_media(self.hass, media_content_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue