Linux downgrade
This commit is contained in:
@ -63,6 +63,10 @@ public class Person
|
||||
|
||||
private void Loop(long ticks, ILogger log)
|
||||
{
|
||||
Uri uri;
|
||||
HttpClient httpClient = new();
|
||||
string fileName;
|
||||
Task<byte[]> task;
|
||||
int age;
|
||||
string json;
|
||||
string code;
|
||||
@ -210,6 +214,18 @@ public class Person
|
||||
personDisplayDirectory = Path.Combine(_AppSettings.SaveDirectory, ticks.ToString(), $"{personName.First.Value} {personName.Last.Value}~{approximateYears}");
|
||||
if (!Directory.Exists(personDisplayDirectory))
|
||||
_ = Directory.CreateDirectory(personDisplayDirectory);
|
||||
log.Information("Enter url to download an image (press enter if none)");
|
||||
line = System.Console.ReadLine();
|
||||
log.Information(". . .");
|
||||
if (!string.IsNullOrEmpty(line))
|
||||
{
|
||||
uri = new(line);
|
||||
if (uri.HostNameType != UriHostNameType.Dns)
|
||||
continue;
|
||||
task = httpClient.GetByteArrayAsync(uri);
|
||||
fileName = Path.Combine(personDisplayDirectory, Path.GetFileName(uri.LocalPath));
|
||||
File.WriteAllBytes(fileName, task.Result);
|
||||
}
|
||||
if (dateTime is null)
|
||||
personKeyFormatted = "2";
|
||||
else
|
||||
|
Reference in New Issue
Block a user