Open basti4557 opened 10 months ago
Good catch!
SpotifyWebApi.getPlaylistUri
is only used by the SpotifyAppController to manage the temporary cloned playlists of the buggy Liked Songs and Artist Radio playlists. If a user has add 50 playlists since the last time AAIdrive has updated this cloned playlist, I expect it will create a duplicate at the top of the list, or perhaps throw an error and not enable this workaround for skipping in these playlists. I personally dislike this workaround and wish it wasn't even needed, so I haven't tried polishing this particular facet :)
Definitely something to fix at some point! You can check the example for how AAIdrive iterates through the contents of a playlist.
When using spotify with many playlists (51+) a problem with GetPlaylistUri can occur. The API call in getPlaylistUri() is limited to 50 entries with offset 0.
See: https://developer.spotify.com/documentation/web-api/reference/get-list-users-playlists
The Solution would be using the "total" key in the response to calculate a type of "pagination" to cycle through all playlists. For example:
Total 150 should be 3 pages, so fetch getClientPlaylists(50,0), getClientPlaylists(50,50) and getClientPlaylists(50,100)
https://github.com/BimmerGestalt/AAIdrive/blob/30f40ae8af05b9bceb10a6f8973af6a023a820dd/app/src/main/java/me/hufman/androidautoidrive/music/spotify/SpotifyWebApi.kt#L140