music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.2k stars 44 forks source link

Airplay groups have display and playback issues when a member is disabled or deleted #2509

Open madbrain76 opened 1 week ago

madbrain76 commented 1 week ago

What version of Music Assistant has the issue?

2.0.7

What version of the Home Assistant Integration have you got installed?

2024.6.2

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

It is possible to delete or disable a player that is part of a group, but display and playback issues ensue

How to reproduce

  1. add Airplay provider
  2. go to settings / player
  3. click "add group player"
  4. click "Airplay"
  5. name the player "Bath + bed"
  6. select 2 players. I chose "downstairs bathroom" and "downstairs bedroom"
  7. click save
  8. disable "downstairs bathroom" using the | menu
  9. click the "bath + bed" group
  10. Observe that "Group members" shows an odd name for the missing player image
  11. on the bottom right, select the "bath + bed" player
  12. go to albums
  13. click an album
  14. click the blue "play" button on top
  15. receive the error "unhandled errors in a TaskGroup (1 sub-exception) image

While 10 and 15 are two different issues, I believe they stem from the same invalid state created in step 8.

The same symptoms occur if a member is deleted in step 8, rather than disabled.

Music Providers

File system (remote)

Player Providers

Airplay

Full log output

log.txt

Additional information

While one should not do this intentionally as I did, it is sure to occur to some accidentally.

There are lots of possible ways to deal with it. Here are some suggestions, some of which complement each other, and some of which are exclusionary. Obviously, there are many possible edge cases. Some of these are simple (a), others not as much.

a. tell the user that the player is a group member, and it can't be disabled or deleted until it is first manually removed from the group(s). List the groups to help the user do this. b. same as a, but the player automatically gets removed from the group(s) c. keep the disabled player in the groups, but display its name rather than the odd string, and show it as disabled (maybe a different color, stricken, etc). For the delete case, automatically remove it from the groups. d. automatically disable group(s) whose members are disabled. For deleted members, just remove them e. keep the disabled player in the group, and allow the group to be used for playback, but only on the remaining (enabled) players members f. if there are no remaining members (all members deleted), delete the group, and notify the user g. if the group contains only disabled members, automatically disable it, too

What version of Home Assistant Core are your running

2024.6.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Windows