aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain CECCHETTO <cecchetto.sylvain@me.com>2023-12-17 18:40:06 +0100
committerSylvain CECCHETTO <cecchetto.sylvain@me.com>2023-12-19 20:39:49 +0100
commit02a81daabcd71a4194aaf39ffe4c048719aab39b (patch)
treeb40aedc3ab5c172f1b619975da85f176fd6997c9
parent601718ad5c54c02ddbb158b234b2a688c619f6dc (diff)
[tvOS] Fix binary addons (PVR) multi instance settings reset
-rw-r--r--xbmc/platform/darwin/tvos/TVOSNSUserDefaults.mm13
-rw-r--r--xbmc/platform/darwin/tvos/filesystem/TVOSFileUtils.mm1
2 files changed, 3 insertions, 11 deletions
diff --git a/xbmc/platform/darwin/tvos/TVOSNSUserDefaults.mm b/xbmc/platform/darwin/tvos/TVOSNSUserDefaults.mm
index 93707608cb..a30a21554d 100644
--- 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::string& path,
std::vector<std::string>& contents)
{
- // tvos path adds /private/../..
- // We need to strip this as GetUserHomeDirectory() doesnt have private in the path
- std::string subpath = path;
- const std::string& str_private = "/private";
- size_t pos = subpath.find(str_private.c_str(), 0, str_private.length());
-
- if (pos != std::string::npos)
- subpath.erase(pos, str_private.length());
-
std::string userDataDir =
URIUtils::AddFileToFolder(CTVOSFileUtils::GetUserHomeDirectory(), "userdata");
- if (subpath.find(userDataDir) == std::string::npos)
+ if (path.find(userDataDir) == std::string::npos)
return;
NSDictionary<NSString*, id>* dict =
@@ -94,7 +85,7 @@ void CTVOSNSUserDefaults::GetDirectoryContents(const std::string& path,
std::string fullKeyPath =
URIUtils::AddFileToFolder(CTVOSFileUtils::GetUserHomeDirectory(), keypath);
std::string endingDirectory = URIUtils::GetDirectory(fullKeyPath);
- if (subpath == endingDirectory)
+ if (path == endingDirectory)
{
contents.push_back(fullKeyPath);
}
diff --git a/xbmc/platform/darwin/tvos/filesystem/TVOSFileUtils.mm b/xbmc/platform/darwin/tvos/filesystem/TVOSFileUtils.mm
index 8877c99e44..333ba622ab 100644
--- 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);
});