fix: fixing stale downloads not resetting

This commit is contained in:
Chubby Granny Chaser
2024-05-30 00:40:39 +01:00
parent 84c746ef35
commit 1171e95b87
8 changed files with 25 additions and 21 deletions

View File

@@ -8,10 +8,9 @@ const removeGame = async (
await gameRepository.update(
{
id: gameId,
status: "removed",
},
{
status: null,
status: "removed",
downloadPath: null,
bytesDownloaded: 0,
progress: 0,

View File

@@ -18,6 +18,7 @@ const startGameDownload = async (
gameRepository.findOne({
where: {
objectID,
shop,
},
relations: { repack: true },
}),
@@ -28,7 +29,7 @@ const startGameDownload = async (
}),
]);
if (!repack || game?.status === "active") return;
if (!repack) return;
await DownloadManager.pauseDownload();
@@ -44,6 +45,8 @@ const startGameDownload = async (
},
{
status: "active",
progress: 0,
bytesDownloaded: 0,
downloadPath,
downloader,
repack: { id: repackId },