Make RetrievePlaytime pull time directly from save

This commit is contained in:
Pancakes 2025-04-25 12:53:03 -04:00
parent 857bdee976
commit add5fbc326
No known key found for this signature in database
GPG Key ID: 5792877BFA27DC8F
2 changed files with 12 additions and 13 deletions

View File

@ -219,13 +219,12 @@ func DeleteSessionSaveData(uuid []byte, slot int) error {
}
func RetrievePlaytime(uuid []byte) (int, error) {
var playtime int
err := handle.QueryRow("SELECT playTime FROM accountStats WHERE uuid = ?", uuid).Scan(&playtime)
system, err := ReadSystemSaveData(uuid)
if err != nil {
return 0, err
}
return playtime, nil
return int(system.GameStats.(map[string]interface{})["playTime"].(float64)), nil
}
func GetSystemSaveFromS3(uuid []byte) (defs.SystemSaveData, error) {