Compare commits

...

3 Commits

Author SHA1 Message Date
Franck Nijhof 582e8935ab Use walrus operator for entries check 2026-05-28 11:50:41 +00:00
Franck Nijhof a8f45ecda8 Handle no loaded entries in Jellyfin media source 2026-05-28 11:48:49 +00:00
Franck Nijhof 0e7f3668a4 Fix Jellyfin media source crash when entry is not loaded 2026-05-28 11:18:39 +00:00
@@ -53,7 +53,9 @@ _LOGGER = logging.getLogger(__name__)
async def async_get_media_source(hass: HomeAssistant) -> MediaSource:
"""Set up Jellyfin media source."""
# Currently only a single Jellyfin server is supported
entry: JellyfinConfigEntry = hass.config_entries.async_entries(DOMAIN)[0]
if not (entries := hass.config_entries.async_loaded_entries(DOMAIN)):
raise BrowseError("Jellyfin integration not loaded")
entry: JellyfinConfigEntry = entries[0]
coordinator = entry.runtime_data
return JellyfinSource(hass, coordinator.api_client, entry)