* Added recursive game scan and only using game directories

* Added recursion depth limit to scan directories

* Added recursive search by ID in cli mode

* Added recursive search to pkg installing
This commit is contained in:
pdaloxd 2025-01-31 09:50:02 +01:00 committed by GitHub
parent 8057ed408c
commit f3c33b29dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 117 additions and 20 deletions

View file

@ -167,12 +167,12 @@ int main(int argc, char* argv[]) {
// Check if the provided path is a valid file
if (!std::filesystem::exists(eboot_path)) {
// If not a file, treat it as a game ID and search in install directories
// If not a file, treat it as a game ID and search in install directories recursively
bool game_found = false;
const int max_depth = 5;
for (const auto& install_dir : Config::getGameInstallDirs()) {
const auto candidate_path = install_dir / game_path / "eboot.bin";
if (std::filesystem::exists(candidate_path)) {
eboot_path = candidate_path;
if (auto found_path = Common::FS::FindGameByID(install_dir, game_path, max_depth)) {
eboot_path = *found_path;
game_found = true;
break;
}