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