-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix startup time #382
Merged
Merged
Fix startup time #382
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change prevents loading of Spotify playlists from blocking other common Mopidy operations. These include startup and browsing, as well as refreshing of playlists in general. Loading Spotify playlists will always happen in a dedicated thread, and only one refresh thread will run at a time. The playlists_loaded event is manually re-dispatched when Spotify is done loading playlists, as a signal that clients should refresh their list of playlists. This is necessary, as otherwise clients relying solely on websocket notifications may never discover the newly-loaded playlists.
kingosticks
added
C-enhancement
Category: A PR with an enhancement or an issue with an enhancement proposal
A-webapi
Area: Spotify Web API
labels
Mar 12, 2024
kingosticks
force-pushed
the
fix-startup-time
branch
from
March 12, 2024 01:17
0ba9e6c
to
e20a83a
Compare
Do with a bit more testing with some other clients to ensure behaviour makes sense. |
jodal
approved these changes
Mar 12, 2024
adamcik
reviewed
Mar 12, 2024
kingosticks
force-pushed
the
fix-startup-time
branch
2 times, most recently
from
March 13, 2024 00:27
3592a8a
to
a3c9b43
Compare
kingosticks
force-pushed
the
fix-startup-time
branch
from
March 13, 2024 01:05
a3c9b43
to
836f089
Compare
This was referenced Mar 13, 2024
Chasing the last bit of coverage found a bug. The system works! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-webapi
Area: Spotify Web API
C-enhancement
Category: A PR with an enhancement or an issue with an enhancement proposal
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this is the best of both worlds since it gets the playlist names immediately, avoids blocking Mopidy startup, but still gathers the track info in the background to make everything snappy later on.