2014-07-12, 06:06 PM
I've had this issue for awhile, and it finally got annoying enough that I decided to look into it a bit more. What happens is that if I haven't used XNEWA in awhile (i.e. first thing in the morning), it can take several seconds (sometimes 10 - 12 seconds) for any X-NEWA window to open. While I'm waiting I can do other stuff in XBMC, so for a long time I thought I just hadn't hit the remote button correctly. The problem seems much worse on my Windows machine (where Next PVR is as well) than on my OSX machine (where I do my development work).
After walking the code a bit, the best I can figure is that it has something to do with the suds object cache created in XNEWA_Connect. The thing is, all that accounts for about 10 lines of code, and I can't see anyway to optimize it (or even why it would be causing a problem). So I attacked it from the other end. I decided it the lag is going to be there, at least it would be nice to know XNEWA was starting. So I added a dialog to default.py similar to the one used when the channel icons are cached. In Gotham, it uses the newer background dialog (a little less obtrusive IMHO), but that's somewhat a style choice.
Just below the first import I added:
Then the XNEWA_Connect call looks like this instead:
The message you actually see is "Connecting to NextPVR." I thought I'd share in case there was interest in adding that to the shipping version. If there's interest in migrating more of the progress dialogs to background dialogs, I'd be happy to look at that. I'd probably opt to wait for the next official release so that I'm not working too much on the older codebase I have here.
After walking the code a bit, the best I can figure is that it has something to do with the suds object cache created in XNEWA_Connect. The thing is, all that accounts for about 10 lines of code, and I can't see anyway to optimize it (or even why it would be causing a problem). So I attacked it from the other end. I decided it the lag is going to be there, at least it would be nice to know XNEWA was starting. So I added a dialog to default.py similar to the one used when the channel icons are cached. In Gotham, it uses the newer background dialog (a little less obtrusive IMHO), but that's somewhat a style choice.
Just below the first import I added:
Code:
from xbmcaddon import Addon
if int( xbmc.getInfoLabel( "System.BuildVersion" ).split('.')[0] ) >= 13:
from xbmcgui import DialogProgressBG as _dialog
else:
from xbmcgui import DialogProgress as _dialog
Then the XNEWA_Connect call looks like this instead:
Code:
sDialog = _dialog()
sDialog.create( 'X-NEWA', '%s %s' % (smartUTF8(__language__(30153)), smartUTF8(__language__(30000))) )
my_xnewa = XNEWA_Connect(settings=my_settings)
sDialog.close()
The message you actually see is "Connecting to NextPVR." I thought I'd share in case there was interest in adding that to the shipping version. If there's interest in migrating more of the progress dialogs to background dialogs, I'd be happy to look at that. I'd probably opt to wait for the next official release so that I'm not working too much on the older codebase I have here.