am: fix save data being deleted on CIA install failure (#1319)

This commit is contained in:
PabloMK7 2025-08-20 14:48:34 +02:00 committed by GitHub
parent 219b8dca2e
commit 48db1c1de5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -864,8 +864,10 @@ bool CIAFile::Close() {
if (!complete) { if (!complete) {
LOG_ERROR(Service_AM, "CIAFile closed prematurely, aborting install..."); LOG_ERROR(Service_AM, "CIAFile closed prematurely, aborting install...");
if (!is_additional_content) { if (!is_additional_content) {
FileUtil::DeleteDirRecursively( // Only delete the content folder as there may be user save data in the title folder.
GetTitlePath(media_type, container.GetTitleMetadata().GetTitleID())); const std::string title_content_path =
GetTitlePath(media_type, container.GetTitleMetadata().GetTitleID()) + "content/";
FileUtil::DeleteDirRecursively(title_content_path);
} }
return true; return true;
} }