housekeeping on Plugin exit
#1
I've a new video plugin which gather files into a cache, which are parsed and then directory lists are populated, this ultimatly leads to a video to be played. which is fine. But, I'd like my 'cache' to be cleared when Plugin is finally closed.

This is easy to do from a script, as it starts once then exits, whereas a Plugin is launched and closed for each directory you move into. SO its difficult to know if the Plugin has finished of just being re-called.

Is there a way of detecting the Plugin has been closed (ie. you back out to the Video Plugins screen) so a single final clear of the cache can be done ?

On the point of the plugin 'launch and close' for each directory call - Is there away of retaining information in variables from one call to the next ?

I wish to maintain a urlopener, that has been previously initialised with a HTTP Basic Auth. and Cookie handlers, rather than having to re-init the urlopener each time Plugin is loaded because of the next directory call.

Hope that made some sense to someone?
cheers
BBB
Retired from Add-on dev
Reply
#2
Thinking a bit more about the way plugins do their own internal caching...

If Plugin goes 'back' a directory level, can that directory be re-loaded from the internal cache or is it down to the Plugin to re-populate, from either own cached files or re-downloading the data ?
Retired from Add-on dev
Reply
#3
I had the same problem Billy , it`s not yet been resolved, as far as i`m aware.

http://forum.xbmc.org/showthread.php?tid=42146
Reply
#4
and I thought I'd search the forums well enough on that subject.

ok, thanks for that. It probs best I don't cache anything.

Any ideas on maintaining vars or is it the case that for each call the plugin is re-init ?

cheers
Retired from Add-on dev
Reply
#5
Basically: The script is loaded and unloaded on each dir fetch. Nothing is kept around, so anything python vars you have will need to be reinit'd on each fetch.

You can save information in any way you like (eg to disk, or at worse, embed in the URL you return).

Reinit'ing everything at the "root" level is an idea perhaps (i.e. cache clear on start rather than on end?)

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
At beginning! yes that would be ideal. It hadn't crossed my mind, I was too busy looking for a way on exit.

thanks
Retired from Add-on dev
Reply
#7
for the media windows a call to ClearProperties() at root might be a good idea also.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
I don't see the ClearProperties() apart from a reference in GUIMediaWindow.cpp, whats it do / got an example call from a plugin ?

BBB
Retired from Add-on dev
Reply
#9
it's internal only, my comment was for jmarshall. it clears window.property()'s

edit: let me clarify. there is a python method clearProperties() that does this, but i was refering to the internal ClearProperties()
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
housekeeping on Plugin exit0