small fixes

This commit is contained in:
Stanley Dimant
2022-09-28 17:03:21 +02:00
parent c2e92c094c
commit 1fee097481
5 changed files with 60 additions and 26 deletions

View File

@@ -157,8 +157,11 @@ public class CachedPlayer
while ((toDownloadReplacements = TryCalculateModdedDictionary(out moddedPaths)).Count > 0 && attempts++ <= 10)
{
Logger.Debug("Downloading missing files for player " + PlayerName + ", kind: " + objectKind);
await _apiController.DownloadFiles(downloadId, toDownloadReplacements, downloadToken);
_apiController.CancelDownload(downloadId);
if (toDownloadReplacements.Any())
{
await _apiController.DownloadFiles(downloadId, toDownloadReplacements, downloadToken);
_apiController.CancelDownload(downloadId);
}
if (downloadToken.IsCancellationRequested)
{
Logger.Verbose("Detected cancellation");