mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Extend media source URL expiry to 24h (#48912)
This commit is contained in:
parent
65c39bbd92
commit
346af58f27
@ -19,6 +19,8 @@ from . import local_source, models
|
|||||||
from .const import DOMAIN, URI_SCHEME, URI_SCHEME_REGEX
|
from .const import DOMAIN, URI_SCHEME, URI_SCHEME_REGEX
|
||||||
from .error import Unresolvable
|
from .error import Unresolvable
|
||||||
|
|
||||||
|
DEFAULT_EXPIRY_TIME = 3600 * 24
|
||||||
|
|
||||||
|
|
||||||
def is_media_source_id(media_content_id: str):
|
def is_media_source_id(media_content_id: str):
|
||||||
"""Test if identifier is a media source."""
|
"""Test if identifier is a media source."""
|
||||||
@ -105,7 +107,7 @@ async def websocket_browse_media(hass, connection, msg):
|
|||||||
{
|
{
|
||||||
vol.Required("type"): "media_source/resolve_media",
|
vol.Required("type"): "media_source/resolve_media",
|
||||||
vol.Required(ATTR_MEDIA_CONTENT_ID): str,
|
vol.Required(ATTR_MEDIA_CONTENT_ID): str,
|
||||||
vol.Optional("expires", default=30): int,
|
vol.Optional("expires", default=DEFAULT_EXPIRY_TIME): int,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@websocket_api.async_response
|
@websocket_api.async_response
|
||||||
|
Loading…
x
Reference in New Issue
Block a user