Posts: 33
Joined: Jun 2023
Reputation:
1
lpence
Junior Member
Posts: 33
2023-07-08, 13:45
(This post was last modified: 2023-07-17, 13:55 by lpence. Edited 1 time in total.)
Hello I am using the following code and it is actually working on Windows and mac OSx however it does not work on Android. It gives the followin error on Android 'squlite3.OperationalError: unable to open database file'.
What I am doing wrong do I need to use a different approach to get it working across all platforms?
DB_FILMS_FILE = "rtd_films.db"
DB_FILMS = xbmcvfs.translatePath("special://profile/addon_data/%s/%s" % (PLUGIN_NAME, DB_FILMS_FILE))
Thanks in advance
Posts: 1,665
Joined: Jun 2011
Reputation:
119
Also I'd like to recommend to check what paths you are actually getting from Kodi API.
Posts: 33
Joined: Jun 2023
Reputation:
1
lpence
Junior Member
Posts: 33
2023-07-13, 19:29
(This post was last modified: 2023-07-17, 13:56 by lpence. Edited 1 time in total.)
ok with that code I am reading/writing to the db file in windows, linux and macosx in the following locations:
"/library/Application Support/Kodi/userdata/addon_data/plugin.video.rtd/rtd_films.db"
I would like to do the same in Android!
But in Android I get 'squlite3.OperationalError: unable to open database file'
Posts: 33
Joined: Jun 2023
Reputation:
1
lpence
Junior Member
Posts: 33
I am new trying to put some code together for kodi...
Is there a path solution to be used in all kodi platforms for all platforms or do I need to use a specific one when using it for Android ?
If thus is the case how do I arrange the code for 'if' to get these options?
I can see this in the wiki for Android:
special://xbmc - /data/data/org.xbmc.kodi/cache/apk/assets/
special://home - /sdcard/Android/data/org.xbmc.kodi/files/.kodi/
special://temp - /sdcard/Android/data/org.xbmc.kodi/files/.kodi/temp/
Posts: 33
Joined: Jun 2023
Reputation:
1
lpence
Junior Member
Posts: 33
Updating my lat post here is what I got out from Mac OSx:
2023-07-15 08:19:44.790 T:756184 debug <general>: My addon's special path is: /Users/pence/Library/Application Support/Kodi/addons/plugin.video.rtd/
2023-07-15 08:19:44.790 T:756184 debug <general>: My addon's translated addon path is: /Users/pence/Library/Application Support/Kodi/addons/plugin.video.rtd/
2023-07-15 08:19:44.791 T:756184 debug <general>: My addon's special profile path is: special://profile/addon_data/plugin.video.rtd/
2023-07-15 08:19:44.791 T:756184 debug <general>: My addon's translated profile path is: /Users/pence/Library/Application Support/Kodi/userdata/addon_data/plugin.video.rtd/
2023-07-15 08:19:47.335 T:756287 debug <general>: My addon's special path is: /Users/pence/Library/Application Support/Kodi/addons/plugin.video.rtd/
2023-07-15 08:19:47.336 T:756287 debug <general>: My addon's translated addon path is: /Users/pence/Library/Application Support/Kodi/addons/plugin.video.rtd/
2023-07-15 08:19:47.337 T:756287 debug <general>: My addon's special profile path is: special://profile/addon_data/plugin.video.rtd/
2023-07-15 08:19:47.337 T:756287 debug <general>: My addon's translated profile path is: /Users/pence/Library/Application Support/Kodi/userdata/addon_data/plugin.video.rtd/
2023-07-15 08:38:31.608 T:767547 debug <general>: My DB file was found
2023-07-15 08:38:33.130 T:767579 debug <general>: My DB file was found
All seems to by correct but still not able to get it to work on Android...
Posts: 33
Joined: Jun 2023
Reputation:
1
lpence
Junior Member
Posts: 33
2023-07-16 08:55:53.740 T:31404 debug <general>: My addon's special path is: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.rtd/
2023-07-16 08:55:53.740 T:31404 debug <general>: My addon's translated addon path is: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.rtd/
2023-07-16 08:55:53.740 T:31404 debug <general>: My addon's special profile path is: special://profile/addon_data/plugin.video.rtd/
2023-07-16 08:55:53.740 T:31404 debug <general>: My addon's translated profile path is: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/plugin.video.rtd/
2023-07-16 08:55:53.741 T:31404 debug <general>: My DB file was not found