feat: add support to new json achievement file structure

This commit is contained in:
Zamitto
2025-04-25 08:32:02 -03:00
parent 6c5a91b410
commit a8e70b4032
2 changed files with 14 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -208,6 +208,19 @@ const processSkidrow = (unlockedAchievements: any): UnlockedAchievement[] => {
const processGoldberg = (unlockedAchievements: any): UnlockedAchievement[] => {
const newUnlockedAchievements: UnlockedAchievement[] = [];
if (Array.isArray(unlockedAchievements)) {
for (const achievement of unlockedAchievements) {
if (achievement?.earned) {
newUnlockedAchievements.push({
name: achievement.name,
unlockTime: achievement.earned_time * 1000,
});
}
}
return newUnlockedAchievements;
}
for (const achievement of Object.keys(unlockedAchievements)) {
const unlockedAchievement = unlockedAchievements[achievement];