2023-12-20, 11:08
Does that mean the next nightly build will have this fix, since it’s „merged“?
(2023-12-16, 15:10)sy6sy2 Wrote: Hi all,I very much think this is the issue. I find it important to note that: you dont need to restart to see changes are not stored, you can just change the name of your configuration to 'test', and close the window, reopen it, close the setting pannel, reopen it, its reverted to 'unknown', close the extension open another, and back to the setting pannel of PVR, and its back to original name 'migrated...'
@emveepee pointed the finder on the right direction about this issue, thanks to him!
I also investigated on my side and it seems that Kodi (on Apple TV of course) mixing paths with and without the/private
prefix.
In reality thegetenv("HOME")
line at beginning of the runtime return a path with/private
prefix whileCTVOSFileUtils::GetOSCachesDirectory()
functions return a path without this prefix.
This cause some issue in the DirectoryCache system because some directories are registered with this prefix and other without, causing some file existence check to fail.
This is the issue with the multi instance PVR addons, they are not able to find the existing XML setting file because the Directorycache system thinks this file does not exist despite it really exists...
The patch proposed by emveepee should works, but my proposal fix is to use the/private
prefix everywhere in Kodi to avoid any confusion or complexity.
This is my proposal:
Code:
--- a/xbmc/platform/darwin/tvos/filesystem/TVOSFileUtils.mm
+++ b/xbmc/platform/darwin/tvos/filesystem/TVOSFileUtils.mm
@@ -35,6 +35,7 @@ const char* CTVOSFileUtils::GetOSCachesDirectory()
std::call_once(cache_flag, [] {
NSString* cachePath =
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
+ cachePath = [@"/private" stringByAppendingString:cachePath];
cacheFolder = cachePath.UTF8String;
URIUtils::RemoveSlashAtEnd(cacheFolder);
});
Code:
--- a/xbmc/platform/darwin/tvos/TVOSNSUserDefaults.mm
+++ b/xbmc/platform/darwin/tvos/TVOSNSUserDefaults.mm
@@ -67,19 +67,10 @@ bool CTVOSNSUserDefaults::Synchronize()
void CTVOSNSUserDefaults::GetDirectoryContents(const std:tring& path,
std::vector<std:tring>& contents)
{
- // tvos path adds /private/../..
- // We need to strip this as GetUserHomeDirectory() doesnt have private in the path
- std:tring subpath = path;
- const std:tring& str_private = "/private";
- size_t pos = subpath.find(str_private.c_str(), 0, str_private.length());
-
- if (pos != std:tring::npos)
- subpath.erase(pos, str_private.length());
-
std:tring userDataDir =
URIUtils::AddFileToFolder(CTVOSFileUtils::GetUserHomeDirectory(), "userdata");
- if (subpath.find(userDataDir) == std:tring::npos)
+ if (path.find(userDataDir) == std:tring::npos)
return;
What do you think?