Several second delay before busy dialog shows up

Hey again,

I’m in the process of trying to debug an addon.

The problem that I’m seeing is that this addon (not the default “Movies” functionality of Kodi) will generate a “list” of movie posters, but when you click the poster, it can take several seconds before the loading progress dialog is visible. Furthermore, during those several seconds it’s possible to keep moving to other List items (menu selections or posters/icons/etc), or even click select again and start multiple addon instances.

I’m further confused with the fact that the latest KODI documentation says that xbmcgui.DialogBusy has been removed, yet it seems to be everywhere in the OSMC skin.

Sorry, this is probably really scattered since I’m not exactly sure where to start to debug this.

Basically, I want something that will at least block further movement/selections after any onClick action that triggers code.

So is the delay on clicking on any item of a List (menus or images), and the delay before the addon functionality starts, an issue of Kodi, the OSMC skin, or the addon?

From what I can tell, this addon is handing off all display and onClick handling to the default xbmc libraries, as I searched through the code and I don’t see a single onClick handler, and unfortunately I don’t know Python well enough to understand how what module/class is specified when creating a list.

My guess is that I should be able to create a default class that is called by any list onClick, and use an additional parameter to pass off to the specific module that needs to run. Am I on the right track with that thinking?

THANKS!
-Zac

What addon? Is there a reason you haven’t named an integral part of the issue you wish to address?

When you are talking about addons, you should be starting with the developer of the addon.

What does any of that have to do with the question that I asked?!?!

If you MUST know, it was an addon that I found in an old repo. There was no author name, and the url listed in the comments was no longer registered. Basically it plays back videos off an old version of a Red 5 Media Server. I have this server sitting on an old machine that’s running GDrive that syncs my videos off my phones. I wrote a perl CGI that outputs xml used by the addon to build its List of thumbnails and populate those thumbnails with the url to the video to play. It pulls an xml file, and then pulls the individual thumbs which are dumped into a .

It seemed a simple enough addon to learn on, though it has some features like search, play counter, etc. that I want to remove, and I want to add in an “enter pin” screen before playing a video that’s marked private, etc.

The core issue is, I believe, network related because I’m likewise seeing a several second delay when I load a website from my browser, etc. I built my own router, and there’s either a misconfiguration of my DNS or firewall.

REGARDLESS!

There is a several second delay between clicking the thumbnail, and starting the video. And the delay isn’t presenting as starting the video player and then buffering, It looks like it’s making an interim call back to the media server to update a play count, or something else (I haven’t learned python well enough yet to dig into the code beyond changing the settings for my server name, and it did give an example of the xml it was expecting.).

As a test I tried it in the estuary skin, and there are no delays; immediately upon clicking on the poster, a busy window pops up. What what’s the delay that the OSMC skin in introducing between onClick and execute of the python script?

Which skin are you using that doesn’t show a delay?

Sam

A skin doesn’t contain any code, it’s just a collection of layout files and images. Turn on debugging, check the logs to see if there is any obvious difference in what is occurring when the thing is clicked in both skins. There might be something like a skin shortcuts addon being called and debug logging might show it.

The default estuary skin. Could it be somehow related to the busy animation use by OSMC? I don’t see any situation where that would somehow take longer to load in one place but not another, but since I don’t see the behavior consistent everywhere.

Since this addon has only one call to ‘ActivateWindow(busydialog)’ in a script that doesn’t even seem to be called as part of the main script function that I’m using, I’m guessing that the “busy dialog”/animation is automated by an xbmc class based upon some onClick event of a DisplayList?

If so, what would cause the delay in that being triggered?

I’m grasping at straws. I’m trying to setup an eclipse debugger, but no one has updated the pydev documentation in so long that it’s difficult to do so.

Wow, coming from a specifically Typed language like Java, Python is SO not intuitive to me!

But it looks like the main issue I’m seeing is because this addon is doing some threading. Apparently the “busy” dialog is triggered by Kodi itself? So when the called script throws up a thread and then dies off, the busy dialog goes away, allowing other actions to occur in the interim, then the thread finishes it’s work and throws up XBMCGUI elements.
Python is especially unintuitive when it comes to how it does threading, so I’m learning slowly.

Since this is (what I thought was) a basic app, I’m just using it to rewrite the whole thing from scratch.

Thanks for the words of advice and clarification everyone.