Skip to content
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 4 commits into from
Mar 13, 2024
Merged

Fix startup time #382

merged 4 commits into from
Mar 13, 2024

Conversation

kingosticks
Copy link
Member

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.

djmattyg007 and others added 3 commits March 11, 2024 23:30
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 kingosticks self-assigned this Mar 12, 2024
@kingosticks 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 kingosticks added this to the 5.0 (Replace libspotify) milestone Mar 12, 2024
@kingosticks
Copy link
Member Author

Do with a bit more testing with some other clients to ensure behaviour makes sense.

src/mopidy_spotify/playlists.py Outdated Show resolved Hide resolved
src/mopidy_spotify/web.py Outdated Show resolved Hide resolved
src/mopidy_spotify/playlists.py Show resolved Hide resolved
src/mopidy_spotify/playlists.py Outdated Show resolved Hide resolved
src/mopidy_spotify/playlists.py Show resolved Hide resolved
src/mopidy_spotify/playlists.py Outdated Show resolved Hide resolved
src/mopidy_spotify/web.py Outdated Show resolved Hide resolved
src/mopidy_spotify/web.py Outdated Show resolved Hide resolved
@kingosticks kingosticks force-pushed the fix-startup-time branch 2 times, most recently from 3592a8a to a3c9b43 Compare March 13, 2024 00:27
@kingosticks
Copy link
Member Author

Chasing the last bit of coverage found a bug. The system works!

@kingosticks kingosticks merged commit c8f028b into mopidy:main Mar 13, 2024
6 checks passed
@kingosticks kingosticks deleted the fix-startup-time branch March 13, 2024 01:10
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants