From 750fc3595c35685d34283d95731781f27a54d0f2 Mon Sep 17 00:00:00 2001 From: Maufeat Date: Wed, 7 Jan 2026 21:33:16 +0100 Subject: [PATCH] don't call RebuildExternalContentIndex on service initi --- src/core/core.cpp | 2 ++ .../hle/service/filesystem/filesystem.cpp | 23 +++++++++++-------- src/qt_common/util/content.cpp | 2 ++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index bf97184f8f..b2fb39a91f 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -343,6 +343,8 @@ struct System::Impl { return init_result; } + fs_controller.RebuildExternalContentIndex(); + // Initialize cheat engine if (cheat_engine) { cheat_engine->Initialize(); diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 05445cf13a..28632a31b6 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -725,7 +725,6 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove external_provider.get()); } - RebuildExternalContentIndex(); } void FileSystemController::RebuildExternalContentIndex() { @@ -735,16 +734,20 @@ void FileSystemController::RebuildExternalContentIndex() { } if (!Settings::values.external_dirs.empty()) { - FileSys::ExternalContentPaths paths{}; - for (const auto& dir : Settings::values.external_dirs) { - if (dir.empty()) - continue; - paths.update_dirs.push_back(dir); - paths.dlc_dirs.push_back(dir); + try { + FileSys::ExternalContentPaths paths{}; + for (const auto& dir : Settings::values.external_dirs) { + if (dir.empty()) + continue; + paths.update_dirs.push_back(dir); + paths.dlc_dirs.push_back(dir); + } + FileSys::ExternalContentIndexer indexer{system.GetFilesystem(), + *this->external_provider, std::move(paths)}; + indexer.Rebuild(); + } catch (const std::exception& e) { + LOG_ERROR(Service_FS, "Failed to rebuild external content index: {}", e.what()); } - FileSys::ExternalContentIndexer indexer{system.GetFilesystem(), *this->external_provider, - std::move(paths)}; - indexer.Rebuild(); } else { external_provider->ClearAllEntries(); } diff --git a/src/qt_common/util/content.cpp b/src/qt_common/util/content.cpp index c190e11410..b4f034deb6 100644 --- a/src/qt_common/util/content.cpp +++ b/src/qt_common/util/content.cpp @@ -160,6 +160,7 @@ void InstallFirmware(const QString& location, bool recursive) // Re-scan VFS for the newly placed firmware files. system->GetFileSystemController().CreateFactories(*vfs); + system->GetFileSystemController().RebuildExternalContentIndex(); auto VerifyFirmwareCallback = [&](size_t total_size, size_t processed_size) { progress.setValue(90 + static_cast((processed_size * 10) / total_size)); @@ -275,6 +276,7 @@ void InstallKeys() = FirmwareManager::InstallKeys(key_source_location.toStdString(), "keys"); system->GetFileSystemController().CreateFactories(*QtCommon::vfs); + system->GetFileSystemController().RebuildExternalContentIndex(); const QString resMsg = GetKeyInstallResultString(result); switch (result) {