0

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

gordie
  • 1,637
  • 3
  • 21
  • 41

2 Answers2

0

I guess you can just store your request results in the Kodi data folder

Alex B
  • 70
  • 7
0

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'))
Roman Miroshnychenko
  • 1,496
  • 1
  • 10
  • 16