Skip to content

Commit

Permalink
Download Manager part 4
Browse files Browse the repository at this point in the history
Fix Download list
  • Loading branch information
cheburashkalev committed Apr 5, 2023
1 parent b40d4c5 commit b04ba0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion GameLauncher_MAUI_CSharp/Global/DownloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ await GitHubDownloader.Download(
(o, x) => { if (DownloadProgressChanged != null) DownloadProgressChanged.Invoke(new object(), new DownloadGameProgressEventArgs() { GameId = GameId, DownloadProgressArgs = x }); },
async (o, x) =>
{
DownloadList.Remove(new DownloadKey() { Gameid = GameId, PartDownload = partDownload });
var OldDownload = DownloadList.Keys.FirstOrDefault(x => x.Gameid == GameId && x.PartDownload == partDownload);
if (OldDownload != null)
{
DownloadList.Remove(OldDownload);
}
await PartDownload(GameId, AllParts, CurrentDownload,SaveDir);
},
(o, x) => { if (DownloadGameStart != null) { DownloadGameStart.Invoke(new object(), new DownloadGameStartEventArgs() { GameId = GameId }); } }
Expand Down
2 changes: 1 addition & 1 deletion GameLauncher_MAUI_CSharp/Global/GitHubDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static async Task<IDownload> Download(
download.DownloadFileCompleted += DownloadFileCompleted;
download.DownloadStarted += DownloadStarted;

await download.StartAsync();
download.StartAsync();
return download;
}

Expand Down

0 comments on commit b04ba0c

Please sign in to comment.