mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-31 14:51:02 +00:00
Merge branch 'feature/game-achievements' into chore/test-preview
This commit is contained in:
@@ -23,7 +23,27 @@ export const watchAchievements = async () => {
|
|||||||
|
|
||||||
if (games.length === 0) return;
|
if (games.length === 0) return;
|
||||||
|
|
||||||
await searchForAchievements(games);
|
const achievementFiles = await findAllAchievementFiles();
|
||||||
|
|
||||||
|
for (const game of games) {
|
||||||
|
const gameAchievementFiles = achievementFiles.get(game.objectID) || [];
|
||||||
|
const achievementFileInsideDirectory =
|
||||||
|
findAchievementFileInExecutableDirectory(game);
|
||||||
|
|
||||||
|
gameAchievementFiles.push(...achievementFileInsideDirectory);
|
||||||
|
|
||||||
|
if (!gameAchievementFiles.length) continue;
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"Achievements files to observe for:",
|
||||||
|
game.title,
|
||||||
|
gameAchievementFiles
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const file of gameAchievementFiles) {
|
||||||
|
compareFile(game, file);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const processAchievementFileDiff = async (
|
const processAchievementFileDiff = async (
|
||||||
@@ -101,27 +121,3 @@ const compareFile = async (game: Game, file: AchievementFile) => {
|
|||||||
fileStats.set(file.filePath, -1);
|
fileStats.set(file.filePath, -1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchForAchievements = async (games: Game[]) => {
|
|
||||||
const achievementFiles = await findAllAchievementFiles();
|
|
||||||
|
|
||||||
for (const game of games) {
|
|
||||||
const gameAchievementFiles = achievementFiles.get(game.objectID) || [];
|
|
||||||
const achievementFileInsideDirectory =
|
|
||||||
findAchievementFileInExecutableDirectory(game);
|
|
||||||
|
|
||||||
gameAchievementFiles.push(...achievementFileInsideDirectory);
|
|
||||||
|
|
||||||
if (!gameAchievementFiles.length) continue;
|
|
||||||
|
|
||||||
logger.log(
|
|
||||||
"Achievements files to observe for:",
|
|
||||||
game.title,
|
|
||||||
gameAchievementFiles
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const file of gameAchievementFiles) {
|
|
||||||
compareFile(game, file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user