croneter / PlexKodiConnect

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

video nodes slow in loading #182

Closed croneter closed 7 years ago

croneter commented 7 years ago

Is anyone able to set up custom widgets that work reliably? The default Movie / TV Show widgets are working fine for me, but as they combine every Plex library of the same type, it does not display what I need for the widget to be useful. Using the Estuary MOD skin (or any other skin supporting custom menu items), I have set up the main menu items (Plex libraries) I am interested in displaying, adding their corresponding recently added+on deck video nodes as widgets. The thing is, they take forever to load and even after they have been loaded, they will reload the next time the main menu item is highlighted, ie. the custom widgets are not displaying anything unless you stay idle on the main menu for some minutes. This is not the case for the default widgets; they display immediately after loading Kodi and will do so every single time the main menu item (TV Shows / Movies) is highlighted. On another note: I have deleted most of the default Kodi video nodes, so I am actually a bit confused as to where PKC/Kodi is getting the default recently added info - I am unable to browse this "feed". If I could figure this out, I'd expect to be able to explain the above behavior.

Mongjohn commented 7 years ago

What do you need to be able to investigate this?

It seems this may be platform specific. The above description fits an Amazon Fire TV and the Nvidia Shield TV (both Android, stock Kodi). Testing in a Windows 10 VM, the widgets seem to load considerably faster. I am unable to test this using an actual HTPC.

Update: I suspect the reason it's loading faster in the VM is simply because it's a faster machine; it's still doing some loading that isn't happening when the default TV Shows and Movies menu items are highlighted, ie. the default widgets are still loading instantly, whereas the custom ones are loading with a slight delay on Windows and a considerable delay on Android.

Testing in the VM, there is not much of a difference between Jarvis and Krypton when loading the video nodes.

croneter commented 7 years ago

Taking a wild guess here, but this might be a Krypton bug. Keep in mind that we're still talking about a Release Candidate here... Did you check whether there's a known issue on the Kodi Krypton side?

Mongjohn commented 7 years ago

I haven't checked if there are any known issues, and to be honest I wouldn't know what to check; what exactly would the bug be? "Filtered video nodes in PKC are loading slowly compared to the same library item's full view"?

I'm inclined to install Jarvis on one of the Android boxes to check if the issue persists. Would that be of any value to you?

croneter commented 7 years ago

Not really, this is a Krypton issue. But thanks!

Mongjohn commented 7 years ago

Alright. I think the issue boils down to; PKC -> TV Shows -> TV Shows loads instantly. PKC -> TV Shows -> Recently Added takes a while to load, also affecting the widget.

Is this the issue you know is only related to Krypton? Let me know if I can help.

dettwild commented 7 years ago

Not sure if this helps a lot, but I have read somewhere (I think it was in the Titan Beta Skin thread), that some Skins persists the widget content to the local drive so that they can pull it back faster when needed (and update in the background). This may be something that could be asked to the developer of the mentioned Estuary MOD Skin. One other thing that could be tested would be to manually edit the PKC library nodes to change the hard coded Limit of 100 to something smaller like 20. I plan to raise a separate 'Feature Request" Issue here soon to make that limit customizable via settings. With regards to where Kodi gets the default info for 'Recently Added' or 'Next Episodes': I believe some of those do NOT come from Videonodes but rather via the plugin 'scrip.skin.helper.widgets', similar to how PKC defines the path for the 'OnDeck' TV Show node. I hope this helps a bit, even though I think that some of those widgets (especially the TV Shows ones, where PKC talks to Plex) just have a performance impact, especially on weaker system like my Raspberry Pi2.

croneter commented 7 years ago

Update: the slow loading is due to the use of Kodi's ListItem python object, see http://mirrors.xbmc.org/docs/python-docs/stable/xbmcgui.html#ListItem

As a workaround, do reduce the number of displayed PMS items in the PKC settings -> Appearance (new setting coming up in next version)