diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index d6e3efdb5..cf73dab2e 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -1113,13 +1113,21 @@ const QStringList GameList::supported_file_extensions = { }; void GameList::RefreshGameDirectory() { - // Do not scan directories when the system is powered on, it will be // repopulated on shutdown anyways. if (Core::System::GetInstance().IsPoweredOn()) { return; } + const auto time_now = std::chrono::steady_clock::now(); + + // Max of 1 refresh every 1 second. + if (time_last_refresh + std::chrono::seconds(1) > time_now) { + return; + } + + time_last_refresh = time_now; + if (!UISettings::values.game_dirs.isEmpty() && current_worker != nullptr) { LOG_INFO(Frontend, "Change detected in the applications directory. Reloading game list."); PopulateAsync(UISettings::values.game_dirs); diff --git a/src/citra_qt/game_list.h b/src/citra_qt/game_list.h index f74bc297b..2bccd86a3 100644 --- a/src/citra_qt/game_list.h +++ b/src/citra_qt/game_list.h @@ -153,6 +153,8 @@ private: friend class GameListSearchField; const PlayTime::PlayTimeManager& play_time_manager; + + std::chrono::time_point time_last_refresh; }; class GameListPlaceholder : public QWidget {