{"record":{"id":"4045dd4ab45f5e23","repo":"home-assistant/core","slug":"media-not-found-media-content-type-media-con-4045dd","errorCode":null,"errorMessage":"Media not found: {media_content_type} / {media_content_id}","messagePattern":"Media not found: (.+?) / (.+?)","errorType":"exception","errorClass":"BrowseError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/braviatv/media_player.py","lineNumber":181,"sourceCode":"\n    @override\n    async def async_browse_media(\n        self,\n        media_content_type: MediaType | str | None = None,\n        media_content_id: str | None = None,\n    ) -> BrowseMedia:\n        \"\"\"Browse apps and channels.\"\"\"\n        if not media_content_id:\n            await self.coordinator.async_update_sources()\n            return await self.async_browse_media_root()\n\n        path = media_content_id.partition(\"/\")\n        if path[0] == \"apps\":\n            return await self.async_browse_media_apps(True)\n        if path[0] == \"channels\":\n            return await self.async_browse_media_channels(True)\n\n        raise BrowseError(f\"Media not found: {media_content_type} / {media_content_id}\")\n\n    async def async_browse_media_root(self) -> BrowseMedia:\n        \"\"\"Return root media objects.\"\"\"\n\n        return BrowseMedia(\n            title=\"Sony TV\",\n            media_class=MediaClass.DIRECTORY,\n            media_content_id=\"\",\n            media_content_type=\"\",\n            can_play=False,\n            can_expand=True,\n            children=[\n                await self.async_browse_media_apps(),\n                await self.async_browse_media_channels(),\n            ],\n        )\n\n    async def async_browse_media_apps(self, expanded: bool = False) -> BrowseMedia:","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/braviatv/media_player.py#L163-L199","documentation":"BrowseError('Media not found: {media_content_type} / {media_content_id}') raised in async_browse_media (media_player.py:181) when a browse request supplies a non-empty media_content_id whose first path segment is neither 'apps' nor 'channels'. The browser only exposes a two-level tree: root, 'apps', and 'channels'.","triggerScenarios":"media_player.browse_media called with media_content_id like 'app/Netflix', 'favorites', or a deep path — anything where partition('/')[0] is not 'apps' or 'channels'. An empty media_content_id is fine (returns the root).","commonSituations":"Custom Lovelace media-browser panels or scripts that construct their own content IDs instead of following the children returned by the browse tree; stale frontend cache referencing old paths after an integration update.","solutions":["Browse from the root (empty media_content_id) and navigate only through children the integration returns.","Use exactly 'apps' or 'channels' as the top-level path segment.","Clear the browser/app cache if the frontend is sending stale content IDs.","If building a custom UI, pass the media_content_id verbatim from BrowseMedia.children."],"exampleFix":"# before\nawait player.async_browse_media(media_content_type=\"directory\", media_content_id=\"app/Netflix\")\n# after\nawait player.async_browse_media(media_content_type=\"directory\", media_content_id=\"apps\")","handlingStrategy":"validation","validationCode":"root = player.async_browse_media()\nvalid_ids = {c.media_content_id for c in root.children}  # {'apps', 'channels'}\nif media_content_id and media_content_id.partition(\"/\")[0] not in valid_ids:\n    raise BrowseError(f\"Unknown browse path {media_content_id!r}\")","typeGuard":"def is_valid_browse_path(media_content_id: str) -> bool:\n    return not media_content_id or media_content_id.partition(\"/\")[0] in (\"apps\", \"channels\")","tryCatchPattern":"from homeassistant.components.media_player.browse_media import BrowseError\n\ntry:\n    node = await player.async_browse_media(media_content_type, media_content_id)\nexcept BrowseError:\n    node = await player.async_browse_media(\"\", \"\")  # fall back to root","preventionTips":["Always start browsing from the root and follow returned children.","Never hand-assemble media_content_id paths for Bravia.","Clear frontend caches after integration updates that change browse paths."],"tags":["braviatv","home-assistant","media-browser","invalid-input"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}