Change how we display downloading files in the UI

This commit is contained in:
Timothy Baldridge 2022-05-20 17:00:54 -06:00
parent 84e91e28f7
commit acf0bee082
2 changed files with 4 additions and 4 deletions

View File

@ -37,8 +37,8 @@ public class DownloadDispatcher
public async Task<Hash> Download(Archive a, AbsolutePath dest, CancellationToken token)
{
using var downloadScope = _logger.BeginScope("Downloading {primaryKeyString}", a.State.PrimaryKeyString);
using var job = await _limiter.Begin(a.State.PrimaryKeyString, a.Size, token);
using var downloadScope = _logger.BeginScope("Downloading {Name}", a.Name);
using var job = await _limiter.Begin("Downloading " + a.Name, a.Size, token);
return await Download(a, dest, job, token);
}

View File

@ -33,7 +33,7 @@ public class NexusDownloader : ADownloader<Nexus>, IUrlDownloader
private readonly IUserInterventionHandler _userInterventionHandler;
private readonly IResource<IUserInterventionHandler> _interventionLimiter;
private const bool IsManualDebugMode = true;
private const bool IsManualDebugMode = false;
public NexusDownloader(ILogger<NexusDownloader> logger, HttpClient client, IHttpDownloader downloader,
NexusApi api, IUserInterventionHandler userInterventionHandler, IResource<IUserInterventionHandler> interventionLimiter)
@ -115,7 +115,7 @@ public class NexusDownloader : ADownloader<Nexus>, IUrlDownloader
public override async Task<Hash> Download(Archive archive, Nexus state, AbsolutePath destination,
IJob job, CancellationToken token)
{
if (IsManualDebugMode || await _api.IsPremium(token))
if (IsManualDebugMode || !(await _api.IsPremium(token)))
{
return await DownloadManually(archive, state, destination, job, token);
}