xbmcvfs.translatePath not working in Android - 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: xbmcvfs.translatePath not working in Android (/showthread.php?tid=373717) |
xbmcvfs.translatePath not working in Android - lpence - 2023-07-08 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 RE: xbmcvfs.translatePath not working in Android - zachmorris - 2023-07-13 Depending on which path are you trying to get: Code:
RE: xbmcvfs.translatePath not working in Android - Roman_V_M - 2023-07-13 Also I'd like to recommend to check what paths you are actually getting from Kodi API. RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-13 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' RE: xbmcvfs.translatePath not working in Android - izprtxqkft - 2023-07-13 (2023-07-13, 19:29)lpence Wrote: ok with that code I am reading/writing to the db file in windows, linux and macosx in the following locations: special://userdata/addon_data/plugin.video.rtd/films.db should get you there - https://kodi.wiki/view/Special_protocol RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-13 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/ RE: xbmcvfs.translatePath not working in Android - Roman_V_M - 2023-07-13 As @zachmorris pointed, Code: xbmcvfs.translatePath(addon_handle.getAddonInfo('profile')) I'd recommend you to debug your code step by step at least with debug logging to check what paths you are actually getting from Kodi. If Android returns wrong (non existing) paths, then it should be fixed. RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-14 (2023-07-13, 21:51)Roman_V_M Wrote: As @zachmorris pointed, Apologies to ask again but what am I suppose to do with Code: xbmcvfs.translatePath(addon_handle.getAddonInfo('profile')) RE: xbmcvfs.translatePath not working in Android - zachmorris - 2023-07-14 For your purposes, this should work. Code:
What does that spit out in your addon debug log? The special paths you note should be the same (I think), but the above ensures it will be correct, regardless of the weird installs people may have. RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-15 This is what I get:
RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-15 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... RE: xbmcvfs.translatePath not working in Android - pkscout - 2023-07-16 (2023-07-15, 14:42)lpence Wrote: Updating my lat post here is what I got out from Mac OSx: You’re showing us the output from a Mac. Show us the Android output. It’s impossible to help with your Android issue if you don’t show us output from that. RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-16 Just checking if what I am doing is correct: 1- I am using 'Log viewer for kodi 2- I added following lines to my advancedsettings.xml Code: <loglevel>6</loglevel> I do not see any prints on the log about the path! I am probably doing something wrong... Is there any other app to check logger better that the one I am using? What else can I do? tks. RE: xbmcvfs.translatePath not working in Android - izprtxqkft - 2023-07-16 check the easy method here Debug Log RE: xbmcvfs.translatePath not working in Android - lpence - 2023-07-16 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 |