mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-24 22:55:41 +00:00
System: Only update played time when game list is loaded
This commit is contained in:
parent
15b29b4caa
commit
8f267c87c0
|
@ -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;
|
||||||
|
|
|
@ -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 =
|
||||||
|
|
Loading…
Reference in a new issue