mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add alternative objectIds
This commit is contained in:
parent
f5da836b1b
commit
456e7ed809
1 changed files with 16 additions and 6 deletions
|
@ -167,6 +167,14 @@ const getPathFromCracker = async (cracker: Cracker) => {
|
||||||
throw new Error(`Cracker ${cracker} not implemented`);
|
throw new Error(`Cracker ${cracker} not implemented`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getAlternativeObjectIds = (objectId: string) => {
|
||||||
|
if (objectId === "205100") {
|
||||||
|
return ["205100", "217980", "31292"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [objectId];
|
||||||
|
};
|
||||||
|
|
||||||
export const findAchievementFiles = async (game: Game) => {
|
export const findAchievementFiles = async (game: Game) => {
|
||||||
const achievementFiles: AchievementFile[] = [];
|
const achievementFiles: AchievementFile[] = [];
|
||||||
|
|
||||||
|
@ -174,13 +182,15 @@ export const findAchievementFiles = async (game: Game) => {
|
||||||
for (const { folderPath, fileLocation } of await getPathFromCracker(
|
for (const { folderPath, fileLocation } of await getPathFromCracker(
|
||||||
cracker
|
cracker
|
||||||
)) {
|
)) {
|
||||||
const filePath = path.join(folderPath, game.objectID, ...fileLocation);
|
for (const objectId of getAlternativeObjectIds(game.objectID)) {
|
||||||
|
const filePath = path.join(folderPath, objectId, ...fileLocation);
|
||||||
|
|
||||||
if (fs.existsSync(filePath)) {
|
if (fs.existsSync(filePath)) {
|
||||||
achievementFiles.push({
|
achievementFiles.push({
|
||||||
type: cracker,
|
type: cracker,
|
||||||
filePath,
|
filePath,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue