Kodi Community Forum
How to resync virtual directory - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+--- Thread: How to resync virtual directory (/showthread.php?tid=163444)



How to resync virtual directory - billythekids - 2013-04-27

Hi guys,

I'm currently working on xmbc plugins, try to get content from some sites, and display it using virtual directory, in my script i turn on the cache solution and everything works fine now. But now i'm facing the problem to live reload all categories, so i added a context menu to call external script to reload it, but don't know how to replace with the new content. I tried to call xbmcplugin.addDirectoryItem again but without success.

Anyone has any idea how to do it?

Thanks

Billy


RE: How to resync virtual directory - Bstrdsmkr - 2013-04-27

Xbmc.executeBuiltin() and Container.Refresh should do it for you


RE: How to resync virtual directory - billythekids - 2013-04-27

Thank for your help but it didn't work coz the path is not real system dir so refresh wont effect anything. As i understand i must remove all item in the current container, add new item then refresh the container.
But i cant see anywhere build-in command allow me to clean up container


RE: How to resync virtual directory - Bstrdsmkr - 2013-04-28

Use the plugin url which generates the desired new content, for ex:
Code:
plugin://plugin.video.foo/?mode=generateNewContent&my_key=Myvar&foo=bar



RE: How to resync virtual directory - billythekids - 2013-04-30

it didn't help, i tried to figure it out but seems no luck, i always got the invalid handle error


RE: How to resync virtual directory - Bstrdsmkr - 2013-04-30

I'm sorry, I was wrong, it's Container.Update
This is what I'm using:
Code:
url = 'plugin://plugin.video.foo/?mode=generateNewContent&my_key=Myvar&foo=bar'
builtin = 'Container.Update(%s)' %url
xbmc.executebuiltin(builtin)

Also, this is more of a subject for the Python Development section