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 Playlist order from Spotify Library not being used #26

Merged
merged 2 commits into from
May 11, 2021

Conversation

3urobeat
Copy link
Contributor

@3urobeat 3urobeat commented Mar 12, 2021

Hey!
This commit fixes the Playlist list not appearing in the same order as in your Spotify Library.

How:
I did this by adding a new idx parameter to the UserPlaylist class.
This parameter is getting fed by a totalindex variable that counts all iterations of the first and the second (offset) loop which fetch the users playlist data in frontend/spotify_manager.py.
The init function of the PlaylistPage class in view_model.py then sorts the playlists list by getting the idx of each playlist from the UserPlaylist class using the added get_idx() function.

When fetching all playlists using spotipy in refresh_data() the order of supplied playlists was always the same as in the users Spotify library. But this order wasn't kept in the list and therefore also not in the Playlists menu.

Note: Deleting pycache and calling refresh_data() once is necessary.

Another note:
This pull request does not include my changes from my other pull request so if that should get accepted do I then need to add those changes to this branch too? Otherwise they would get reset by this pull request or am I wrong? That would be no problem to do but I just want to ask before doing something stupid and combining these two pull requests together didn't seem logical for me as they address different issues.
Sorry, I haven't worked with pull requests that much.

Edit: Doesn't make sense - the point of pull requests is to update parts of the code and not to replace a whole file.

This commit fixes the Playlist list not appearing in the same order as in your Spotify Library. Deleting pycache and calling refresh_data() once is necessary.
@dupontgu dupontgu merged commit bfdd451 into dupontgu:master May 11, 2021
@3urobeat 3urobeat deleted the playlist-order-fix branch May 11, 2021 22:00
Chickensalad303 pushed a commit to Chickensalad303/SpIpod that referenced this pull request Aug 2, 2024
Fix Playlist order from Spotify Library not being used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants