Skip to content

Commit

Permalink
some minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Aug 22, 2024
1 parent 6da8cad commit 463a452
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions music_assistant/server/helpers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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
Expand Down Expand Up @@ -62,8 +63,11 @@ def send_url(self, auth_url: str) -> None:

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."""
Expand Down
2 changes: 1 addition & 1 deletion music_assistant/server/providers/tunein/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ async def __get_data(self, endpoint: str, **kwargs):
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"
Expand Down

0 comments on commit 463a452

Please sign in to comment.