fix: adjustment to get achievements when file is created after watcher started

This commit is contained in:
Zamitto 2024-10-02 13:59:48 -03:00
parent 05652d9c1b
commit d5b1bcdc7f
2 changed files with 7 additions and 9 deletions

View file

@ -93,14 +93,10 @@ export const findAchievementFileInExecutableDirectory = (
"user_stats.ini" "user_stats.ini"
); );
if (fs.existsSync(steamDataPath)) { return {
return { type: Cracker.generic,
type: Cracker.generic, filePath: steamDataPath,
filePath: steamDataPath, };
};
}
return null;
}; };
export const findAllSteamGameAchievementFiles = () => { export const findAllSteamGameAchievementFiles = () => {

View file

@ -54,7 +54,9 @@ const compareFile = async (game: Game, file: AchievementFile) => {
fileStats.get(file.filePath) fileStats.get(file.filePath)
); );
await processAchievementFile(game, file); await processAchievementFile(game, file);
} catch (err) {} } catch (err) {
fileStats.set(file.filePath, -1);
}
}; };
export const startGameAchievementObserver = async (games: Game[]) => { export const startGameAchievementObserver = async (games: Game[]) => {