Separate Updates from Game Folder (#1026)

* separate updates implementation

* clang format

clang format

clang format

clang format

clang hates me

work please

* hotfix: check for sfo file instead of the folder

* tiny change

* refactor

* forgot to change this over

* add review changes

* use operator
This commit is contained in:
ElBread3 2024-10-15 10:49:42 -05:00 committed by GitHub
parent 29ad2eca62
commit a588bc5da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 135 additions and 12 deletions

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include "common/config.h"
#include "common/string_util.h"
#include "core/file_sys/fs.h"
@ -53,7 +54,14 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view guest_directory, b
// Remove device (e.g /app0) from path to retrieve relative path.
pos = mount->mount.size() + 1;
const auto rel_path = std::string_view(corrected_path).substr(pos);
const auto host_path = mount->host_path / rel_path;
std::filesystem::path host_path = mount->host_path / rel_path;
std::filesystem::path patch_path = mount->host_path;
patch_path += "-UPDATE";
if (corrected_path.starts_with("/app0/") && std::filesystem::exists(patch_path / rel_path)) {
host_path = patch_path / rel_path;
}
if (!NeedsCaseInsensitiveSearch) {
return host_path;
}