-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use non-persistent connection for MPD #94507
Use non-persistent connection for MPD #94507
Commits on Jun 12, 2023
-
Do not use a persistent connection to MPD
In other words, don't rely on the connection management provided by "python-mpd2". Instead of keeping the connection to MPD open, we explicitly connect before and disconnect after each command. There is probably a bit of overhead to this, but as the integration uses a local-polling approach to begin with, no functionality is lost or degraded. This change greatly hardens the MPD integration against both network issues and problems with the daemon itself. All connection-related failure modes have effectively been removed.
Configuration menu - View commit details
-
Copy full SHA for 3400e3c - Browse repository at this point
Copy the full SHA 3400e3cView commit details -
Update state retrieval methods
Only "async_get_media_image" attempts to connect, all others are either called from there, or from the main "async_update" method (see previous commit) which also attempts to connect. So, this commit mainly revolves around gracefully handling situations where no connection is available when trying to retrieve MPD state. Finally, note the removal of "self._commands". This property is only used at the start of "_async_get_file_image_response" and was thus changed into a local variable.
Configuration menu - View commit details
-
Copy full SHA for bb1996f - Browse repository at this point
Copy the full SHA bb1996fView commit details -
Update media-player control methods
These all need to explicitly connect to MPD as part of their flow.
Configuration menu - View commit details
-
Copy full SHA for 1c2577c - Browse repository at this point
Copy the full SHA 1c2577cView commit details
Commits on Jun 13, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 7a422c4 - Browse repository at this point
Copy the full SHA 7a422c4View commit details
Commits on Jun 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9d4a6df - Browse repository at this point
Copy the full SHA 9d4a6dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fbfe38 - Browse repository at this point
Copy the full SHA 5fbfe38View commit details
Commits on Jul 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2e1b30c - Browse repository at this point
Copy the full SHA 2e1b30cView commit details
Commits on Aug 15, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4683ac4 - Browse repository at this point
Copy the full SHA 4683ac4View commit details
Commits on Aug 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3877241 - Browse repository at this point
Copy the full SHA 3877241View commit details
Commits on Aug 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 47c46a0 - Browse repository at this point
Copy the full SHA 47c46a0View commit details -
Initialise "self._status" to empty dictionary
Used to be initialised as None, which caused "NoneType is not iterable" type of issues in case of an unexpected disconnect (at which point status gets set to None again). Instead of guarding against None everywhere, using an empty dictionary seemed more prudent... Furthermore, more cautiously access its members to prevent potential KeyError-s in similar cases.
Configuration menu - View commit details
-
Copy full SHA for 1343e33 - Browse repository at this point
Copy the full SHA 1343e33View commit details -
Fix livelock in "async_mute_volume()"
This method doesn't need a connection; it calls into two other methods that actually connect to MPD – attempting to connect from here resulted in a livelock.
Configuration menu - View commit details
-
Copy full SHA for 3901e92 - Browse repository at this point
Copy the full SHA 3901e92View commit details