System: Only update played time when game list is loaded

This commit is contained in:
Stenzek 2023-09-30 21:42:15 +10:00
parent 15b29b4caa
commit 8f267c87c0
2 changed files with 4 additions and 4 deletions

View file

@ -93,7 +93,7 @@ static std::recursive_mutex s_mutex;
static GameList::CacheMap s_cache_map; static GameList::CacheMap s_cache_map;
static std::unique_ptr<ByteStream> s_cache_write_stream; static std::unique_ptr<ByteStream> s_cache_write_stream;
static bool m_game_list_loaded = false; static bool s_game_list_loaded = false;
const char* GameList::GetEntryTypeName(EntryType type) const char* GameList::GetEntryTypeName(EntryType type)
{ {
@ -111,7 +111,7 @@ const char* GameList::GetEntryTypeDisplayName(EntryType type)
bool GameList::IsGameListLoaded() bool GameList::IsGameListLoaded()
{ {
return m_game_list_loaded; return s_game_list_loaded;
} }
bool GameList::IsScannableFilename(const std::string_view& path) bool GameList::IsScannableFilename(const std::string_view& path)
@ -610,7 +610,7 @@ u32 GameList::GetEntryCount()
void GameList::Refresh(bool invalidate_cache, bool only_cache, ProgressCallback* progress /* = nullptr */) void GameList::Refresh(bool invalidate_cache, bool only_cache, ProgressCallback* progress /* = nullptr */)
{ {
m_game_list_loaded = true; s_game_list_loaded = true;
if (!progress) if (!progress)
progress = ProgressCallback::NullProgressCallback; progress = ProgressCallback::NullProgressCallback;

View file

@ -4661,7 +4661,7 @@ void System::SetTimerResolutionIncreased(bool enabled)
void System::UpdateSessionTime(const std::string& prev_serial) void System::UpdateSessionTime(const std::string& prev_serial)
{ {
const u64 ctime = Common::Timer::GetCurrentValue(); const u64 ctime = Common::Timer::GetCurrentValue();
if (!prev_serial.empty()) if (!prev_serial.empty() && GameList::IsGameListLoaded())
{ {
// round up to seconds // round up to seconds
const std::time_t etime = const std::time_t etime =