Add Person
This commit is contained in:
		| @ -1,3 +1,4 @@ | ||||
| using File_Folder_Helper.Models; | ||||
| using File_Folder_Helper.Models.Exif; | ||||
| using File_Folder_Helper.Models.Face; | ||||
| using Microsoft.Extensions.Logging; | ||||
| @ -35,8 +36,13 @@ internal static class HelperExif | ||||
|         FileInfo fileInfo = new(argZero); | ||||
|         logger.LogInformation("<{argZero}> exists", argZero); | ||||
|         ExifDirectory exifDirectory = Exif.GetExifDirectory(fileInfo); | ||||
|         string directory = Path.GetDirectoryName(argZero) ?? throw new Exception(); | ||||
|         string[] files = Directory.GetFiles(directory, "*.json", SearchOption.TopDirectoryOnly); | ||||
|         string? json = files.Length != 1 ? string.Empty : File.ReadAllText(files[0]); | ||||
|         ReadOnlyCollection<FaceFile> collection = GetCollection(exifDirectory.ExifBaseDirectories); | ||||
|         logger.LogInformation("<{collection}> value", collection.Count); | ||||
|         Dictionary<long, Person>? people = string.IsNullOrEmpty(json) ? [] : JsonSerializer.Deserialize(json, PeopleSourceGenerationContext.Default.DictionaryInt64Person) ?? throw new NullReferenceException(); | ||||
|         logger.LogInformation("<{people}> value", people?.Count); | ||||
|         foreach (FaceFile faceFile in collection) | ||||
|         { | ||||
|             if (faceFile.MappingFromPerson is null) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user