From 463a452ea68bb6eef1ba2fe59dc530e7a7c27624 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 22 Aug 2024 10:25:18 +0200 Subject: [PATCH] some minor tweaks --- music_assistant/server/helpers/auth.py | 8 ++++++-- music_assistant/server/providers/tunein/__init__.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/music_assistant/server/helpers/auth.py b/music_assistant/server/helpers/auth.py index 2700aaf6..76c47741 100644 --- a/music_assistant/server/helpers/auth.py +++ b/music_assistant/server/helpers/auth.py @@ -9,6 +9,7 @@ from typing import TYPE_CHECKING from aiohttp.web import Request, Response from music_assistant.common.models.enums import EventType +from music_assistant.common.models.errors import LoginFailed if TYPE_CHECKING: from music_assistant.server import MusicAssistant @@ -62,8 +63,11 @@ class AuthenticationHelper: async def wait_for_callback(self, timeout: int = 60) -> dict[str, str]: """Wait for the external party to call the callback and return any query strings.""" - async with asyncio.timeout(timeout): - return await self._callback_response.get() + try: + async with asyncio.timeout(timeout): + return await self._callback_response.get() + except TimeoutError as err: + raise LoginFailed("Timeout while waiting for authentication callback") from err async def _handle_callback(self, request: Request) -> Response: """Handle callback response.""" diff --git a/music_assistant/server/providers/tunein/__init__.py b/music_assistant/server/providers/tunein/__init__.py index 6388f413..55265b1b 100644 --- a/music_assistant/server/providers/tunein/__init__.py +++ b/music_assistant/server/providers/tunein/__init__.py @@ -274,7 +274,7 @@ class TuneInProvider(MusicProvider): url = endpoint else: url = f"https://opml.radiotime.com/{endpoint}" - kwargs["formats"] = "ogg,aac,wma,mp3" + kwargs["formats"] = "ogg,aac,wma,mp3,hls" kwargs["username"] = self.config.get_value(CONF_USERNAME) kwargs["partnerId"] = "1" kwargs["render"] = "json" -- 2.34.1