Settings: Don't create deprecated achievement cache directories

This commit is contained in:
Stenzek 2024-08-18 13:04:14 +10:00
parent c6d14febd2
commit 7ac3e2fe50
No known key found for this signature in database
2 changed files with 1 additions and 18 deletions

View file

@ -125,7 +125,6 @@ template<typename... T>
static void ReportFmtError(fmt::format_string<T...> fmt, T&&... args);
template<typename... T>
static void ReportRCError(int err, fmt::format_string<T...> fmt, T&&... args);
static void EnsureCacheDirectoryExists();
static void ClearGameInfo();
static void ClearGameHash();
static std::string GetGameHash(CDImage* image);
@ -427,8 +426,6 @@ bool Achievements::Initialize()
if (IsUsingRAIntegration())
return true;
EnsureCacheDirectoryExists();
auto lock = GetLock();
AssertMsg(g_settings.achievements_enabled, "Achievements are enabled");
Assert(!s_client && !s_http_downloader);
@ -562,9 +559,6 @@ void Achievements::UpdateSettings(const Settings& old_config)
if (g_settings.achievements_unofficial_test_mode != old_config.achievements_unofficial_test_mode)
rc_client_set_unofficial_enabled(s_client, g_settings.achievements_unofficial_test_mode);
}
// in case cache directory changed
EnsureCacheDirectoryExists();
}
bool Achievements::Shutdown(bool allow_cancel)
@ -609,16 +603,6 @@ bool Achievements::Shutdown(bool allow_cancel)
return true;
}
void Achievements::EnsureCacheDirectoryExists()
{
Error error;
if (const std::string path = Path::Combine(EmuFolders::Cache, CACHE_SUBDIRECTORY_NAME);
!FileSystem::EnsureDirectoryExists(path.c_str(), false, &error))
{
ReportFmtError("Failed to create cache directory '{}': {}", CACHE_SUBDIRECTORY_NAME, error.GetDescription());
}
}
void Achievements::ClientMessageCallback(const char* message, const rc_client_t* client)
{
DEV_LOG(message);

View file

@ -1982,8 +1982,7 @@ bool EmuFolders::EnsureFoldersExist()
{
bool result = FileSystem::EnsureDirectoryExists(Bios.c_str(), false);
result = FileSystem::EnsureDirectoryExists(Cache.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_badge").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_gameicon").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_images").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Cheats.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Covers.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Dumps.c_str(), false) && result;