psst icon indicating copy to clipboard operation
psst copied to clipboard

Long playlist - API Pagination limit reached

Open maffelbaffel opened this issue 2 years ago • 2 comments

Describe the bug So here I am sitting with a playlist of 700+ tracks, wondering why Psst can not add more songs to it. Seems like I have reached some sort of fetch limit of the Spotify API?

The last song displayed is the 550th song in that list.

To Reproduce Add 550 songs and another one to a playlist. 551 should not be displayed in that playlist.

Expected behavior Some sort of API paging that fetches all songs.

Environment

  • OS: Linux
  • Version: Latest master branch build

maffelbaffel avatar Mar 27 '22 08:03 maffelbaffel

It seems this also applies to the "Liked Songs" playlist, which seems to be called "Saved Tracks" in psst. I couldn't find a way to count the songs that are shown, but it's much less than in the official client (~2700).

rklasen avatar Jul 19 '22 10:07 rklasen

I have a list of over 2000 (the entirety of my music, just for shuffle library purposes) and judging on Spotify page's count, my last track is also the 550th.

instinctualjealousy avatar Aug 26 '22 16:08 instinctualjealousy

Same issue here. As a workaround, I increased the pagination limit from 500 to 2000 (adjust the maximum to your needs). There's a TODO comment at the corresponding location, so it appears to be a known issue.

diff --git a/psst-gui/src/webapi/client.rs b/psst-gui/src/webapi/client.rs
index 5e9a002..c52a18c 100644
--- a/psst-gui/src/webapi/client.rs
+++ b/psst-gui/src/webapi/client.rs
@@ -158,7 +158,7 @@ impl WebApi {
     ) -> Result<(), Error> {
         // TODO: Some result sets, like very long playlists and saved tracks/albums can
         // be very big.  Implement virtualized scrolling and lazy-loading of results.
-        const PAGED_ITEMS_LIMIT: usize = 500;
+        const PAGED_ITEMS_LIMIT: usize = 2000;
 
         let mut limit = 50;
         let mut offset = 0;

tt37 avatar Oct 25 '22 11:10 tt37