New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use xbmcvfs functions to read and write filesystem files #803
Conversation
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #803 +/- ##
==========================================
- Coverage 21.51% 21.50% -0.02%
==========================================
Files 63 63
Lines 8542 8547 +5
Branches 1572 1572
==========================================
Hits 1838 1838
- Misses 6680 6685 +5
Partials 24 24 ☔ View full report in Codecov by Sentry. |
I don't have an apple device to test with, this seems like it should solve the problem, but it does have the potential to introduce another bug. f = xbmcvfs.File(file_name)
b = f.read()
f.close() In the event there's an issue with |
Thanks for your answer. Did you able to reproduce the issue with try:
b = f.read()
except:
print('Failed to read file')
finally:
f.close() As you said, the context feature is only available since Kodi 19 (or something like that... 😕 ) |
If the content manager works properly for Kodi 19 and later, that is the correct way to go. |
So I will try the context manager version and if it works I will modify this PR 😉 |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Context manager version just pushed. |
will this be fixed in the next update? |
At the moment, this plugin is not working on Apple TV devices.
This is because on tvOS the virtual filesystem used by Kodi hides a more complex system where in reality any XML file of Kodi is compressed in the NSUSerDefaults dictionary.
In others words, that mean that on tvOS a Kodi plugin cannot directly read or write an XML file, instead, the add-on needs to use the
xbmcvfs
functions in order to let Kodi performs the translation between the virtual filesystem and the "real" filesystem that is OS/device dependent.This PR modify the plugin so that the XML reads and writes use
xbmcvfs
functions.This way, this PR allow this add-on to works on tvOS devices.
For more details, see discussion here: https://forum.kodi.tv/showthread.php?tid=374294&pid=3177147#pid3177147
Tested on macOS and Apple TV with Kodi 20.