Kodi Community Forum
where is my database? - 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 is my database? (/showthread.php?tid=101567)



where is my database? - turtle2 - 2011-05-15

Hi guys,

I am having a strange problem.

I wrote a scaper. The scraper puts the data into a sqlite database.

It works beautifully, I see all the debug data running by from the xmbc.log. Creating database, updating database, everything is just fine.

I close XBMC. Open it again and sure, I have a database, the scraper updates the database.

But where is the databaseHuh? Everything works just fine and I even build in debug code to tell me where the database is written: /Users/markvisser/Library/Application Support/XBMC/addons/script.infojunkie/scraper.db

but..... no file there...

Any ideas?
wkr,
Mark


- ronie - 2011-05-15

usually, add-on data is stored in /Users/<your_user_name>/Library/Application Support/XBMC/userdata/addon_data/
so go have a look there. :-)

storing data inside the addon folder itself wouldn't make sense anyway,
as it will be deleted on each update of the add-on.


- turtle2 - 2011-05-15

Indeed, that does make sense... However, it is not there.

I now searched the entire HD. Nothing. But the script in XBMC finds the database and is happely writing to it... strange Undecided


- turtle2 - 2011-05-15

Found it !!

All files that are created are saved in /Applications
Kinda makes sense since XBMC is in that directory. It just makes the files in the root there.


- jmarshall - 2011-05-16

That's because you chose to run XBMC in portable mode (via the -p commandline flag). In this case all data is saved in the portable_data subfolder of wherever XBMC is.


- turtle2 - 2011-05-16

if that is the case, it is not intentionally. I start XBMC by clicking on the XBMC.app in my application folder. I give it no parameters.


- jmarshall - 2011-05-16

Apologies, somehow I got the idea you were on win32. Probably as most users that ask similar questions are on win32!

My next guess is you're running a nightly with external python, and are using os.getcwd() to get the path to your scraper database rather than using the xbmcaddon module to get the correct paths?

Cheers,
Jonathan


- turtle2 - 2011-05-16

:-) correct. I used os.getcwd(). I wrote the scraper outside XBMC and I am now trying to integrate it in XBMC. I found another wiki article about the XBMC library modules so the next step is learning the XBMC environment. :-) Step by step...

wkr,
Mark