croneter / PlexKodiConnect

Plex integration in Kodi done right
GNU General Public License v2.0
1.19k stars 78 forks source link

Add X-Plex-Container-Size to watchlist call and set to maximum #2123

Open VossenTech opened 2 weeks ago

VossenTech commented 2 weeks ago

Current watchlist api call is limited to 20 items by default, adding X-Plex-Container-Size header allows a larger number to be provided. I have set it to 300 as that is the maximum plex will accept

croneter commented 2 weeks ago

Thanks @VossenTech for wanting to contribute.

However, this is not how X-Plex-Container-Size works. Your code would currently only return 300 elements. And then nothing. If someone has more elements than 300, these will never be returned (well, ok, bit unlikely but still). Take a look at plex_functions.DownloadChunks(url) - that's what you want to implement.

What are you trying to fix anyway? Kodi only showing 20 elements in a list? Then my guess is that this is NOT caused by PKC/Plex but by Kodi and the way your widgets are set-up. Some of them "feature" a hard cut-off after X (e.g. X=20) elements.

VossenTech commented 2 weeks ago

Yes what I am trying to fix is Kodi only showing 20 elements in a list, if the limit was caused by Kodi widget setup then I would expect adding X-Plex-Container-Size to have no effect, however after adding it all of my watchlist (35ish items) are shown. I would also expect that going to Add-Ons>PKC>Watchlist would show the entire watchlist regardless of specific Kodi settings (please correct me if I'm wrong), but it was showing the same limited list.

I did realize that it would be limited to 300 and figured it was better than being limited to 20 for the time being. I will look into DownloadChunks/pagination when I have some time to come back to this.

Also thanks for your work on this awesome app that I have been using for many years