Skip to content

Commit

Permalink
Swap order of unsync at power off
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Oct 19, 2024
1 parent 721ebee commit 47ead7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions music_assistant/server/controllers/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ async def cmd_power(self, player_id: str, powered: bool, skip_update: bool = Fal
if player.powered == powered:
return # nothing to do

# unsync player at power off
if not powered and (player.synced_to):
await self.cmd_unsync(player_id)

# always stop player at power off
if (
not powered
Expand All @@ -329,9 +333,6 @@ async def cmd_power(self, player_id: str, powered: bool, skip_update: bool = Fal
):
await self.cmd_stop(player_id)

# unsync player at power off
if not powered and (player.synced_to):
await self.cmd_unsync(player_id)
# power off all synced childs when player is a sync leader
elif not powered and player.type == PlayerType.PLAYER and player.group_childs:
async with TaskManager(self.mass) as tg:
Expand Down

0 comments on commit 47ead7b

Please sign in to comment.