Fix loading state from cache when connecting to slimproto players (#1666)
authorCalvin Walton <calvin.walton@kepstin.ca>
Mon, 16 Sep 2024 05:39:36 +0000 (01:39 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Sep 2024 05:39:36 +0000 (07:39 +0200)
music_assistant/server/providers/slimproto/__init__.py

index 0a8a74306753fd8592f2df9924b5fc5bba61cba7..37b462944bdb8455c98992b67146d404e74ec076 100644 (file)
@@ -861,7 +861,7 @@ class SlimprotoProvider(PlayerProvider):
             )
             self.mass.players.update(_player.player_id)
         # restore volume and power state
-        if last_state := await self.mass.cache.get(f"{CACHE_KEY_PREV_STATE}.{player_id}"):
+        if last_state := await self.mass.cache.get(player_id, base_key=CACHE_KEY_PREV_STATE):
             init_power = last_state[0]
             init_volume = last_state[1]
         else: