mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 19:47:21 +01:00
Download rework (#36)
* handle download ready from signalr * add cancellation to the server * adjust queue for removal and cancellation * adjust api to main Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
parent
f5f9b9c6fc
commit
5a16a15e8b
6 changed files with 74 additions and 72 deletions
|
|
@ -168,8 +168,10 @@ public class CachedPlayer
|
|||
}
|
||||
|
||||
_downloadCancellationTokenSource?.Cancel();
|
||||
_downloadCancellationTokenSource?.Dispose();
|
||||
_downloadCancellationTokenSource = new CancellationTokenSource();
|
||||
var downloadToken = _downloadCancellationTokenSource.Token;
|
||||
|
||||
var downloadId = _apiController.GetDownloadId();
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
|
@ -218,8 +220,6 @@ public class CachedPlayer
|
|||
Logger.Debug("Download Task was cancelled");
|
||||
_apiController.CancelDownload(downloadId);
|
||||
});
|
||||
|
||||
_downloadCancellationTokenSource = null;
|
||||
}
|
||||
|
||||
private List<FileReplacementDto> TryCalculateModdedDictionary(out Dictionary<string, string> moddedDictionary)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue