mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-22 10:23:56 +00:00
feat: update compare achievement response
This commit is contained in:
@@ -11,11 +11,12 @@ import {
|
||||
import type { AchievementFile } from "@types";
|
||||
import { achievementsLogger } from "../logger";
|
||||
import { Cracker } from "@shared";
|
||||
import { IsNull, Not } from "typeorm";
|
||||
|
||||
const fileStats: Map<string, number> = new Map();
|
||||
const fltFiles: Map<string, Set<string>> = new Map();
|
||||
|
||||
export const watchAchievements = async () => {
|
||||
const watchAchiievementsWindows = async () => {
|
||||
const games = await gameRepository.find({
|
||||
where: {
|
||||
isDeleted: false,
|
||||
@@ -23,7 +24,6 @@ export const watchAchievements = async () => {
|
||||
});
|
||||
|
||||
if (games.length === 0) return;
|
||||
|
||||
const achievementFiles = findAllAchievementFiles();
|
||||
|
||||
for (const game of games) {
|
||||
@@ -36,12 +36,6 @@ export const watchAchievements = async () => {
|
||||
|
||||
if (!gameAchievementFiles.length) continue;
|
||||
|
||||
// console.log(
|
||||
// "Achievements files to observe for:",
|
||||
// game.title,
|
||||
// gameAchievementFiles
|
||||
// );
|
||||
|
||||
for (const file of gameAchievementFiles) {
|
||||
compareFile(game, file);
|
||||
}
|
||||
@@ -49,6 +43,27 @@ export const watchAchievements = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const watchAchievementsWithWine = async () => {
|
||||
const games = await gameRepository.find({
|
||||
where: {
|
||||
isDeleted: false,
|
||||
winePrefixPath: Not(IsNull()),
|
||||
},
|
||||
});
|
||||
|
||||
if (games.length === 0) return;
|
||||
|
||||
// TODO: watch achievements with wine
|
||||
};
|
||||
|
||||
export const watchAchievements = async () => {
|
||||
if (process.platform === "win32") {
|
||||
return watchAchiievementsWindows();
|
||||
}
|
||||
|
||||
watchAchievementsWithWine();
|
||||
};
|
||||
|
||||
const processAchievementFileDiff = async (
|
||||
game: Game,
|
||||
file: AchievementFile
|
||||
|
||||
Reference in New Issue
Block a user