Reputation: 1955
I’m writing a video addon that loads datas from a web API.
My problem is that, each time I access an (already) visited virtual folder, it loads the data again, while it could be cached - and it makes my addon slow.
Is there some core function to cache then get cached datas for Kodi addons ?
Thanks
Upvotes: 0
Views: 353
Reputation: 1564
There is no such "core" function, so you need to implement your own caching mechanism. An addon has its "profile" directory where it can store its own arbitrary files. A profile directory path can be obtained the following way:
import xbmcaddon
import xbmcvfs
profile_dir = xbmcvfs.translatePath(xbmcaddon.Addon().getAddonInfo('profile'))
Upvotes: 0