Kodi Community Forum
Where to save addon data? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Where to save addon data? (/showthread.php?tid=164152)



Where to save addon data? - cosmicr - 2013-05-06

I've been using the resources directory of the addon, but I was wondering is there a better place to store data created by an addon?

I see there's the common plugin cache, but I need a place that's more robust (ie won't be deleted upon corruption).

Am I best just to keep using the 'resources' folder?


RE: Where to save addon data? - amet - 2013-05-06

Code:
import xbmcaddon

__addon__ = xbmcaddon.Addon()
__profile__ = xbmc.translatePath( __addon__.getAddonInfo('profile') ).decode("utf-8")

__profile__ would be "userdata/addon_data/<your addon ID>"


RE: Where to save addon data? - cosmicr - 2013-05-06

Excellent, thanks for the reply!


RE: Where to save addon data? - User 206900 - 2017-08-03

Old thread but still a problem of mine.

I guess this is a solution but there must be an easier way.

http://kodi.wiki/view/Add-on_structure

According to this it's normal to have a data folder under the resources directory. Isn't there an easy way to get files from this folder rather than using the above solution? Doing an addon for Kodi 18.


RE: Where to save addon data? - Martijn - 2017-08-03

No its still the same