mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
fix: process user_stats.ini
This commit is contained in:
parent
2a6b757e37
commit
71e7f1ee58
@ -74,11 +74,10 @@ const iniParse = async (filePath: string) => {
|
||||
object[objectName] = {};
|
||||
} else {
|
||||
const [name, ...value] = line.split("=");
|
||||
object[objectName][name.trim()] = value.join("").trim();
|
||||
object[objectName][name.trim()] = value.join("=").trim();
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Parsed ini", object);
|
||||
return object;
|
||||
} catch {
|
||||
return null;
|
||||
@ -222,7 +221,7 @@ const processUserStats = (unlockedAchievements: any): UnlockedAchievement[] => {
|
||||
|
||||
if (!isNaN(unlockTime)) {
|
||||
newUnlockedAchievements.push({
|
||||
name: achievement,
|
||||
name: achievement.replace(/"/g, ``),
|
||||
unlockTime: unlockTime,
|
||||
});
|
||||
}
|
||||
|
@ -61,7 +61,8 @@ export const updateAllLocalUnlockedAchievements = async () => {
|
||||
achievementsLogger.log(
|
||||
"Achievement file for",
|
||||
game.title,
|
||||
achievementFile.filePath
|
||||
achievementFile.filePath,
|
||||
parsedAchievements
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,10 @@ log.transports.file.resolvePathFn = (
|
||||
return path.join(logsPath, "pythoninstance.txt");
|
||||
}
|
||||
|
||||
if (message?.scope == "achievements") {
|
||||
return path.join(logsPath, "achievements.txt");
|
||||
}
|
||||
|
||||
if (message?.level === "error") {
|
||||
return path.join(logsPath, "error.txt");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user