mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
adjust delete-game-folder
This commit is contained in:
parent
7ac7d92a28
commit
2c26fed478
@ -12,10 +12,18 @@ const deleteGameFolder = async (
|
||||
gameId: number
|
||||
): Promise<void> => {
|
||||
const game = await gameRepository.findOne({
|
||||
where: {
|
||||
id: gameId,
|
||||
isDeleted: false,
|
||||
},
|
||||
where: [
|
||||
{
|
||||
id: gameId,
|
||||
isDeleted: false,
|
||||
status: "removed",
|
||||
},
|
||||
{
|
||||
id: gameId,
|
||||
progress: 1,
|
||||
isDeleted: false,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
if (!game) return;
|
||||
@ -33,7 +41,6 @@ const deleteGameFolder = async (
|
||||
);
|
||||
}
|
||||
|
||||
console.log("folder exists");
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
fs.rm(
|
||||
folderPath,
|
||||
@ -48,7 +55,6 @@ const deleteGameFolder = async (
|
||||
}
|
||||
);
|
||||
}).then(async () => {
|
||||
console.log("resolved");
|
||||
await gameRepository.update(
|
||||
{ id: gameId },
|
||||
{ downloadPath: null, folderName: null }
|
||||
|
Loading…
Reference in New Issue
Block a user