mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
d6a1a6bad1
commit
ebc9782eb5
1 changed files with 13 additions and 0 deletions
|
|
@ -211,6 +211,19 @@ private async Task GetLinesFromStream(Stream stream)
|
|||
string line;
|
||||
while ((line = await streamReader.ReadLineAsync()) != null)
|
||||
lines.AddIfNotNullOrEmpty(line.Trim());
|
||||
stream.Position = 0;
|
||||
await SaveOriginalFile(stream);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveOriginalFile(Stream stream)
|
||||
{
|
||||
var fileName = Path.Combine("snapshots", List.Id.ToString(),
|
||||
BitConverter.ToString(SnapEntity.Md5Checksum).Replace("-", "") + ".txt");
|
||||
new FileInfo(fileName).Directory?.Create();
|
||||
using (var fileStream = File.Create(fileName))
|
||||
{
|
||||
await stream.CopyToAsync(fileStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue