Fix Spotify audiobook instance routing (#2502)
authorOzGav <gavnosp@hotmail.com>
Tue, 18 Nov 2025 11:27:42 +0000 (21:27 +1000)
committerGitHub <noreply@github.com>
Tue, 18 Nov 2025 11:27:42 +0000 (12:27 +0100)
music_assistant/providers/spotify/parsers.py
music_assistant/providers/spotify/provider.py

index e3014ab5826d5b9bd5e1044f9a6af96efc37bde5..81720fc87e88234be1cfc0d84a86f09661d028aa 100644 (file)
@@ -341,7 +341,7 @@ def parse_audiobook(audiobook_obj: dict[str, Any], provider: SpotifyProvider) ->
     """Parse spotify audiobook object to generic layout."""
     audiobook = Audiobook(
         item_id=audiobook_obj["id"],
-        provider=provider.lookup_key,
+        provider=provider.instance_id,
         name=audiobook_obj["name"],
         provider_mappings={
             ProviderMapping(
index 75883b24b6d947c91943d556d9abdb205ce1b877..5b6f887ddf5e94c0c64ffae0cd651f8523405002 100644 (file)
@@ -682,7 +682,7 @@ class SpotifyProvider(MusicProvider):
 
             return StreamDetails(
                 item_id=item_id,
-                provider=self.lookup_key,
+                provider=self.instance_id,
                 media_type=MediaType.AUDIOBOOK,
                 audio_format=AudioFormat(content_type=ContentType.OGG, bit_rate=320),
                 stream_type=StreamType.CUSTOM,
@@ -770,6 +770,7 @@ class SpotifyProvider(MusicProvider):
             "refresh_token": refresh_token,
             "client_id": client_id,
         }
+        err = "Unknown error"
         for _ in range(2):
             async with self.mass.http_session.post(
                 "https://accounts.spotify.com/api/token", data=params