From: Marcel van der Veldt Date: Sat, 16 Mar 2024 09:11:21 +0000 (+0100) Subject: Fix playback issues on Qobuz (#1147) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=9f4298d0c273369c7e210f9d4d265ec7a57ffa00;p=music-assistant-server.git Fix playback issues on Qobuz (#1147) --- diff --git a/music_assistant/server/helpers/audio.py b/music_assistant/server/helpers/audio.py index 9550cace..defcffbd 100644 --- a/music_assistant/server/helpers/audio.py +++ b/music_assistant/server/helpers/audio.py @@ -263,7 +263,7 @@ async def get_stream_details(mass: MusicAssistant, queue_item: QueueItem) -> Str continue # provider not available ? # prefer cache item_key = f"{music_prov.lookup_key}/{prov_media.item_id}" - cache_key = f"streamdetails_{item_key}" + cache_key = f"cached_streamdetails_{item_key}" if cache := await mass.cache.get(cache_key): LOGGER.debug(f"Using cached streamdetails for {item_key}") streamdetails = StreamDetails.from_dict(cache) @@ -276,7 +276,9 @@ async def get_stream_details(mass: MusicAssistant, queue_item: QueueItem) -> Str # store streamdetails in cache expiration = streamdetails.expires - time() if expiration > 300: - await mass.cache.set(cache_key, streamdetails.to_dict(), expiration - 60) + await mass.cache.set( + cache_key, streamdetails.to_dict(), expiration=expiration - 60 + ) except MusicAssistantError as err: LOGGER.warning(str(err)) else: diff --git a/music_assistant/server/providers/qobuz/__init__.py b/music_assistant/server/providers/qobuz/__init__.py index e8f1cfc7..f4f20291 100644 --- a/music_assistant/server/providers/qobuz/__init__.py +++ b/music_assistant/server/providers/qobuz/__init__.py @@ -412,7 +412,7 @@ class QobuzProvider(MusicProvider): ), duration=streamdata["duration"], data=streamdata, # we need these details for reporting playback - expires=time.time() + 3600, # not sure about the real allowed value + expires=time.time() + 60, # may not be cached direct=streamdata["url"], )