mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
ren method
This commit is contained in:
parent
4659dd1945
commit
8e7306ebd9
5 changed files with 5 additions and 5 deletions
|
|
@ -7,6 +7,6 @@ namespace FilterLists.Agent.Core.List
|
|||
{
|
||||
public interface IListRepository
|
||||
{
|
||||
Task<Stream> GetListStreamAsync(Uri url, CancellationToken cancellationToken);
|
||||
Task<Stream> GetAsStreamAsync(Uri url, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ public Handler(IListRepository listRepository)
|
|||
protected override async Task Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
var destinationPath = BuildDestinationPath(request);
|
||||
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var output = File.OpenWrite(destinationPath);
|
||||
await input.CopyToAsync(output, cancellationToken);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public Handler(IListRepository listRepository)
|
|||
protected override async Task Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
var destinationDirectoryPath = Path.Combine(RepoDirectory, $"{request.ListUrl.Id}");
|
||||
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var archive = SevenZipArchive.Open(input);
|
||||
foreach (var entry in archive.Entries)
|
||||
if (!entry.IsDirectory)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public Handler(IListRepository listRepository)
|
|||
protected override async Task Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
var destinationDirectoryPath = Path.Combine(RepoDirectory, $"{request.ListUrl.Id}");
|
||||
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
|
||||
using var reader = ReaderFactory.Open(input);
|
||||
while (reader.MoveToNextEntry())
|
||||
if (!reader.Entry.IsDirectory)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public ListRepository(HttpClient httpClient, ILogger<ListRepository> logger)
|
|||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<Stream> GetListStreamAsync(Uri url, CancellationToken cancellationToken)
|
||||
public async Task<Stream> GetAsStreamAsync(Uri url, CancellationToken cancellationToken)
|
||||
{
|
||||
using var response = await _httpClient.GetAsync(url, cancellationToken);
|
||||
if (response.IsSuccessStatusCode)
|
||||
|
|
|
|||
Loading…
Reference in a new issue