fix: file not being processed if it was created after watcher started

This commit is contained in:
Zamitto 2024-10-05 23:07:14 -03:00
parent 57118ec5b9
commit 1ea64d7243

View file

@ -79,7 +79,14 @@ const compareFile = async (game: Game, file: AchievementFile) => {
const previousStat = fileStats.get(file.filePath);
fileStats.set(file.filePath, currentStat.mtimeMs);
if (!previousStat || previousStat === currentStat.mtimeMs) {
if (!previousStat) {
if (currentStat.mtimeMs) {
await processAchievementFileDiff(game, file);
return;
}
}
if (previousStat === currentStat.mtimeMs) {
return;
}