From 022d9904da41726e6046b22d05497f2f9034534e Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Sun, 31 Jul 2022 00:28:29 -0700 Subject: [PATCH] Save Grouped Face Encodings --- Instance/DlibDotNet.cs | 43 +++++++++---- Instance/Models/_D_Face.cs | 101 ++++++++++++++++++++---------- Instance/Models/_E2_Navigate.cs | 4 -- Instance/Models/_E3_Rename.cs | 4 -- Instance/Models/_E_Distance.cs | 70 +++++++++++++++++++++ Property/Models/PropertyHolder.cs | 10 ++- 6 files changed, 178 insertions(+), 54 deletions(-) diff --git a/Instance/DlibDotNet.cs b/Instance/DlibDotNet.cs index 2cc2c73..85fec26 100644 --- a/Instance/DlibDotNet.cs +++ b/Instance/DlibDotNet.cs @@ -48,6 +48,7 @@ public class DlibDotNet _FileKeyValuePairs = new List>(); _FilePropertiesKeyValuePairs = new Dictionary>>(); Property.Models.Configuration propertyConfiguration = Property.Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory); + _Log.Information(propertyConfiguration.RootDirectory); Property.Models.Configuration.Verify(propertyConfiguration); Models.Configuration configuration = Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory, propertyConfiguration); Verify(configuration); @@ -101,9 +102,10 @@ public class DlibDotNet { E2_Navigate e2Navigate = new(console, configuration, argZero); e2Navigate.Navigate(propertyConfiguration, model, predictorModel, configuration.OutputResolutions[0]); + _Log.Information(propertyConfiguration.RootDirectory); } if (!configuration.SkipSearch.Value) - Search(propertyConfiguration, configuration.JuliePhares, configuration.Reverse.Value, model, predictorModel, argZero, people); + Search(propertyConfiguration, configuration.Reverse.Value, model, predictorModel, argZero, people); if (_Exceptions.Count == 0 && _ArgZeroIsConfigurationRootDirectory) { long ticks = DateTime.Now.Ticks; @@ -549,7 +551,7 @@ public class DlibDotNet } } - private void FullDoWork(Property.Models.Configuration configuration, string[] juliePhares, Model model, PredictorModel predictorModel, string argZero, Dictionary> peopleCollection, PropertyLogic propertyLogic, List propertyHolderCollections) + private void FullDoWork(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, string argZero, Dictionary> peopleCollection, PropertyLogic propertyLogic, List propertyHolderCollections) { if (_Log is null) throw new Exception($"{nameof(_Log)} is null!"); @@ -561,12 +563,10 @@ public class DlibDotNet object @lock = new(); string sourceDirectory; long ticks = DateTime.Now.Ticks; - string modelName = model.ToString(); List> faceCollections = new(); List propertyCollection = new(); PropertyHolder[] filteredPropertyHolderCollection; List propertyFileInfoCollection = new(); - string predictorModelName = predictorModel.ToString(); List> resizeKeyValuePairs = new(); List> sourceDirectoryChanges = new(); List>> metadataCollection = new(); @@ -668,10 +668,29 @@ public class DlibDotNet _Exceptions.Add(sourceDirectory); if (_ArgZeroIsConfigurationRootDirectory && exceptionCount == 0) WriteGroup(configuration, propertyLogic, propertyCollection, metadataCollection, faceCollections, resizeKeyValuePairs, sourceDirectory, outputResolution, filteredPropertyHolderCollection); - if (_ArgZeroIsConfigurationRootDirectory && outputResolution == _Configuration.OutputResolutions[0] && exceptionCount == 0) + if (_ArgZeroIsConfigurationRootDirectory && exceptionCount == 0 && outputResolution == _Configuration.OutputResolutions[0]) propertyLogic.AddToPropertyLogicAllCollection(filteredPropertyHolderCollection); - if (exceptionCount == 0 && _Configuration.SaveShortcutsForOutputResolutions.Contains(outputResolution) && propertyLogic.NamedFaceInfoDeterministicHashCodeIndices.Any()) - _Faces.SaveShortcuts(configuration, juliePhares, model, predictorModel, propertyLogic, peopleCollection, outputResolution, filteredPropertyHolderCollection, propertyCollection, faceCollections); + if (_ArgZeroIsConfigurationRootDirectory && exceptionCount == 0 && propertyLogic.NamedFaceInfoDeterministicHashCodeIndices.Any()) + { + if (outputResolution == _Configuration.OutputResolutions[0] || _Configuration.SaveShortcutsForOutputResolutions.Contains(outputResolution)) + { + List<(PropertyHolder, (string, D_Face?, (string, string, string, string))[])> collections = D_Face.GetCollection(configuration, model, predictorModel, propertyLogic, peopleCollection, outputResolution, filteredPropertyHolderCollection, faceCollections); + if (outputResolution == _Configuration.OutputResolutions[0]) + { + foreach ((PropertyHolder propertyHolder, (string, D_Face?, (string, string, string, string))[] collection) in collections) + { + foreach ((string personKey, D_Face? face, (string directory, string copyDirectory, string copyFileName, string shortcutFileName)) in collection) + { + if (string.IsNullOrEmpty(personKey) || face is null || string.IsNullOrEmpty(directory)) + continue; + propertyHolder.AddNamed(directory, personKey, face); + } + } + } + if (_Configuration.SaveShortcutsForOutputResolutions.Contains(outputResolution)) + D_Face.SaveShortcuts(_Configuration.JuliePhares, peopleCollection, collections); + } + } if (exceptionCount == 0 && _Configuration.LoadOrCreateThenSaveDistanceResultsForOutputResolutions.Contains(outputResolution)) _Distance.LoadOrCreateThenSaveDistanceResultsForOutputResolutions(configuration, model, predictorModel, sourceDirectory, outputResolution, sourceDirectoryChanges, filteredPropertyHolderCollection, faceCollections); if (_Resize.AngleBracketCollection.Any()) @@ -690,14 +709,12 @@ public class DlibDotNet } _Log.Information(". . ."); } - } - if (_ArgZeroIsConfigurationRootDirectory && _Configuration.SaveShortcutsForOutputResolutions.Contains(outputResolution)) - { - } if (_ArgZeroIsConfigurationRootDirectory && outputResolution == _Configuration.OutputResolutions[0]) { propertyLogic.SaveAllCollection(); + if (propertyLogic.NamedFaceInfoDeterministicHashCodeIndices.Any()) + E_Distance.SaveGroupedFaceEncodings(configuration, model, predictorModel, argZero, peopleCollection, outputResolution, propertyHolderCollections); if (!_Configuration.LoadOrCreateThenSaveImageFacesResultsForOutputResolutions.Any()) break; if (_Exceptions.Count == 0) @@ -728,12 +745,12 @@ public class DlibDotNet return result; } - private void Search(Property.Models.Configuration configuration, string[] juliePhares, bool reverse, Model model, PredictorModel predictorModel, string argZero, Person[] people) + private void Search(Property.Models.Configuration configuration, bool reverse, Model model, PredictorModel predictorModel, string argZero, Person[] people) { PropertyLogic propertyLogic = GetPropertyLogic(); Dictionary> peopleCollection = A2_People.Convert(people); List propertyHolderCollections = Property.Models.Stateless.A_Property.Get(configuration, reverse, model, predictorModel, propertyLogic); - FullDoWork(configuration, juliePhares, model, predictorModel, argZero, peopleCollection, propertyLogic, propertyHolderCollections); + FullDoWork(configuration, model, predictorModel, argZero, peopleCollection, propertyLogic, propertyHolderCollections); } internal void RenameQueue(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel) => _Rename.RenameQueue(configuration, model, predictorModel); diff --git a/Instance/Models/_D_Face.cs b/Instance/Models/_D_Face.cs index 4c4a48d..4e7b1b7 100644 --- a/Instance/Models/_D_Face.cs +++ b/Instance/Models/_D_Face.cs @@ -503,42 +503,47 @@ public class D_Face : Shared.Models.Properties.IFace, IFace SaveFaces(faceCollection, resizedFileInfo, imageFiles); } - internal void SaveShortcuts(Property.Models.Configuration configuration, string[] juliePhares, Model model, PredictorModel predictorModel, PropertyLogic propertyLogic, Dictionary> peopleCollection, string outputResolution, PropertyHolder[] filteredPropertyHolderCollection, List propertyCollection, List> faceCollections) + internal static List<(PropertyHolder, (string, D_Face?, (string, string, string, string))[])> GetCollection(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, PropertyLogic propertyLogic, Dictionary> peopleCollection, string outputResolution, PropertyHolder[] filteredPropertyHolderCollection, List> faceCollections) { + List<(PropertyHolder, (string, D_Face?, (string, string, string, string))[])> results = new(); string[] keys; - string fileName; - string fullName; string personKey; string directory; bool? isWrongYear; - FileInfo fileInfo; TimeSpan timeSpan; + string copyFileName; DateTime? birthDate; string copyDirectory; string? relativePath; string isWrongYearFlag; + string shortcutFileName; string subDirectoryName; DateTime minimumDateTime; + List indices = new(); List faceCollection; PropertyHolder propertyHolder; - WindowsShortcut windowsShortcut; - const string pattern = @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]"; + List<(string, D_Face?, (string, string, string, string))> collection; string dFacesContentDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(D_Face), outputResolution, includeResizeGroup: true, includeModel: true, includePredictorModel: true), "(_)"); for (int i = 0; i < filteredPropertyHolderCollection.Length; i++) { + indices.Clear(); personKey = string.Empty; + copyFileName = string.Empty; copyDirectory = string.Empty; propertyHolder = filteredPropertyHolderCollection[i]; if (propertyHolder.ImageFileInfo is null) continue; - fileInfo = propertyHolder.ImageFileInfo; relativePath = Path.GetDirectoryName($"C:{propertyHolder.RelativePath}"); if (string.IsNullOrEmpty(relativePath) || relativePath.Length < 3) continue; if (propertyHolder.Property?.Id is null || propertyHolder.MinimumDateTime is null || propertyHolder.ResizedFileInfo is null) continue; + collection = new(); if (!propertyLogic.NamedFaceInfoDeterministicHashCodeIndices.ContainsKey(propertyHolder.Property.Id.Value)) + { + faceCollection = new(); directory = Path.Combine(dFacesContentDirectory, $"Unnamed{relativePath[2..]}"); + } else { faceCollection = faceCollections[i]; @@ -555,6 +560,7 @@ public class D_Face : Shared.Models.Properties.IFace, IFace directory = Path.Combine(dFacesContentDirectory, $"Many{relativePath[2..]}", subDirectoryName); else { + indices.Add(0); personKey = keys[0]; if (isWrongYear is not null && !isWrongYear.Value && personKey[..2] is "19" or "20") { @@ -570,38 +576,69 @@ public class D_Face : Shared.Models.Properties.IFace, IFace } } } - directory = Path.Combine(dFacesContentDirectory, "Named Shortcuts", personKey, subDirectoryName); - if (juliePhares.Contains(personKey)) - copyDirectory = Path.Combine(dFacesContentDirectory, "Named Images", personKey, subDirectoryName); + directory = Path.Combine(dFacesContentDirectory, "Shortcuts", personKey, subDirectoryName); + copyDirectory = Path.Combine(dFacesContentDirectory, "Images", personKey, subDirectoryName); + copyFileName = Path.Combine(copyDirectory, $"{propertyHolder.Property.Id.Value}{propertyHolder.ResizedFileInfo.Extension}"); } } - if (!Directory.Exists(directory)) + shortcutFileName = Path.Combine(directory, $"{propertyHolder.Property.Id.Value}.lnk"); + if (string.IsNullOrEmpty(personKey) || !indices.Any()) + collection.Add(new(personKey, null, (directory, copyDirectory, copyFileName, shortcutFileName))); + else { - _ = Directory.CreateDirectory(directory); - if (!string.IsNullOrEmpty(personKey) && peopleCollection.ContainsKey(personKey)) + foreach (int index in indices) + collection.Add(new(personKey, faceCollection[index], (directory, copyDirectory, copyFileName, shortcutFileName))); + } + results.Add(new(propertyHolder, collection.ToArray())); + } + return results; + } + + internal static void SaveShortcuts(string[] juliePhares, Dictionary> peopleCollection, List<(PropertyHolder, (string, D_Face?, (string Directory, string CopyDirectory, string CopyFileName, string ShortcutFileName))[])> collections) + { + Person person; + string fileName; + string fullName; + WindowsShortcut windowsShortcut; + const string pattern = @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]"; + foreach ((PropertyHolder propertyHolder, (string personKey, D_Face? face, (string, string, string, string))[] collection) in collections) + { + if (collection.Length != 1) + continue; + foreach ((string personKey, D_Face? face, (string directory, string copyDirectory, string copyFileName, string shortcutFileName)) in collection) + { + if (string.IsNullOrEmpty(personKey)) + continue; + if (propertyHolder.Property?.Id is null || propertyHolder.ImageFileInfo is null || propertyHolder.MinimumDateTime is null || propertyHolder.ResizedFileInfo is null) + continue; + if (!Directory.Exists(directory)) { - Person person = peopleCollection[personKey][0]; - fullName = Regex.Replace($"{Shared.Models.Stateless.Methods.IPersonName.GetFullName(person.Name)}.txt", pattern, string.Empty); - File.WriteAllText(Path.Combine(directory, fullName), string.Empty); + _ = Directory.CreateDirectory(directory); + if (!string.IsNullOrEmpty(personKey) && peopleCollection.ContainsKey(personKey)) + { + person = peopleCollection[personKey][0]; + fullName = Regex.Replace($"{Shared.Models.Stateless.Methods.IPersonName.GetFullName(person.Name)}.txt", pattern, string.Empty); + File.WriteAllText(Path.Combine(directory, fullName), string.Empty); + } } - } - if (!string.IsNullOrEmpty(copyDirectory)) - { - if (!Directory.Exists(copyDirectory)) - _ = Directory.CreateDirectory(copyDirectory); - fileName = Path.Combine(copyDirectory, $"{propertyHolder.Property.Id.Value}{propertyHolder.ResizedFileInfo.Extension}"); + if (juliePhares.Contains(personKey) && !string.IsNullOrEmpty(copyDirectory)) + { + if (!Directory.Exists(copyDirectory)) + _ = Directory.CreateDirectory(copyDirectory); + fileName = Path.Combine(copyDirectory, $"{propertyHolder.Property.Id.Value}{propertyHolder.ResizedFileInfo.Extension}"); + if (!File.Exists(fileName)) + File.Copy(propertyHolder.ResizedFileInfo.FullName, fileName); + } + fileName = Path.Combine(directory, $"{propertyHolder.Property.Id.Value}.lnk"); + if (File.Exists(fileName)) + continue; + windowsShortcut = new() { Path = propertyHolder.ImageFileInfo.FullName }; + windowsShortcut.Save(fileName); + windowsShortcut.Dispose(); if (!File.Exists(fileName)) - File.Copy(propertyHolder.ResizedFileInfo.FullName, fileName); + continue; + File.SetLastWriteTime(fileName, propertyHolder.MinimumDateTime.Value); } - fileName = Path.Combine(directory, $"{propertyHolder.Property.Id.Value}.lnk"); - if (File.Exists(fileName)) - continue; - windowsShortcut = new() { Path = fileInfo.FullName }; - windowsShortcut.Save(fileName); - windowsShortcut.Dispose(); - if (!File.Exists(fileName)) - continue; - File.SetLastWriteTime(fileName, propertyHolder.MinimumDateTime.Value); } } diff --git a/Instance/Models/_E2_Navigate.cs b/Instance/Models/_E2_Navigate.cs index fd48bd8..085c4e7 100644 --- a/Instance/Models/_E2_Navigate.cs +++ b/Instance/Models/_E2_Navigate.cs @@ -45,8 +45,6 @@ internal class E2_Navigate string? rootResultsDirectory = Path.GetDirectoryName(Property.Models.Stateless.IResult.GetResultsGroupDirectory(configuration, nameof(B_Metadata))); if (string.IsNullOrEmpty(rootResultsDirectory)) throw new Exception(); - string modelName = model.ToString(); - string predictorModelName = predictorModel.ToString(); string rootResultsDirectoryAbsoluteUri = new Uri(rootResultsDirectory).AbsoluteUri; string dFacesContentDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(D_Face), outputResolution, includeResizeGroup: true, includeModel: true, includePredictorModel: true), "()"); string cResizeContentDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(C_Resize), outputResolution, includeResizeGroup: true, includeModel: false, includePredictorModel: false), "()"); @@ -78,8 +76,6 @@ internal class E2_Navigate string? rootResultsDirectory = Path.GetDirectoryName(Property.Models.Stateless.IResult.GetResultsGroupDirectory(configuration, nameof(B_Metadata))); if (string.IsNullOrEmpty(rootResultsDirectory)) throw new Exception(); - string modelName = model.ToString(); - string predictorModelName = predictorModel.ToString(); string rootResultsDirectoryAbsoluteUri = new Uri(rootResultsDirectory).AbsoluteUri; string dFacesContentDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(D_Face), outputResolution, includeResizeGroup: true, includeModel: true, includePredictorModel: true), "()"); string cResizeContentDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(C_Resize), outputResolution, includeResizeGroup: true, includeModel: false, includePredictorModel: false), "()"); diff --git a/Instance/Models/_E3_Rename.cs b/Instance/Models/_E3_Rename.cs index be7c796..a18e91a 100644 --- a/Instance/Models/_E3_Rename.cs +++ b/Instance/Models/_E3_Rename.cs @@ -42,10 +42,8 @@ internal class E3_Rename string aPropertySingletonDirectory; string bMetadataSingletonDirectory; string eDistanceCollectionDirectory; - string modelName = model.ToString(); string g2IdentifyCollectionDirectory; string d2FaceLandmarksContentDirectory; - string predictorModelName = predictorModel.ToString(); add = Directory.Exists(string.Concat(Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(C_Resize), _Configuration.ValidResolutions[0], includeResizeGroup: true, includeModel: false, includePredictorModel: false), "()"), relativePath)); bMetadataSingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(configuration, nameof(B_Metadata), "{}"); if (Directory.Exists(bMetadataSingletonDirectory)) @@ -129,11 +127,9 @@ internal class E3_Rename string eDistanceContentDirectory; string bMetadataSingletonDirectory; string aPropertySingletonDirectory; - string modelName = model.ToString(); string eDistanceCollectionDirectory; string g2IdentifyCollectionDirectory; string d2FaceLandmarksContentDirectory; - string predictorModelName = predictorModel.ToString(); if (!string.IsNullOrEmpty(relativePath)) { from = string.Concat(_Configuration.PropertyConfiguration.RootDirectory, relativePath); diff --git a/Instance/Models/_E_Distance.cs b/Instance/Models/_E_Distance.cs index e893fd7..bbc7015 100644 --- a/Instance/Models/_E_Distance.cs +++ b/Instance/Models/_E_Distance.cs @@ -1,5 +1,6 @@ using System.Text; using System.Text.Json; +using System.Text.RegularExpressions; using View_by_Distance.FaceRecognitionDotNet; using View_by_Distance.Metadata.Models; using View_by_Distance.Property.Models; @@ -400,4 +401,73 @@ internal class E_Distance } } + private static Dictionary> Convert(string argZero, List propertyHolderCollections) + { + Dictionary> results = new(); + string key; + foreach (PropertyHolder[] propertyHolderCollection in propertyHolderCollections) + { + if (!propertyHolderCollection.Any()) + continue; + if (!propertyHolderCollection[0].SourceDirectory.StartsWith(argZero)) + continue; + foreach (PropertyHolder propertyHolder in propertyHolderCollection) + { + if (propertyHolder.ImageFileInfo is null || propertyHolder.Property is null || !propertyHolder.Named.Any()) + continue; + foreach ((string directory, string personKey, object @object) in propertyHolder.Named) + { + if (string.IsNullOrEmpty(directory) || string.IsNullOrEmpty(personKey) || !directory.Contains(personKey)) + continue; + if (@object is not D_Face face || face.FaceEncoding is null) + continue; + key = directory.Split(personKey)[1]; + if (!results.ContainsKey(key)) + results.Add(key, new()); + results[key].Add(new(directory, personKey, face)); + } + } + } + return results; + } + + internal static void SaveGroupedFaceEncodings(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, string argZero, Dictionary> peopleCollection, string outputResolution, List propertyHolderCollections) + { + string json; + string checkFile; + string directory; + Shared.Models.Person person; + List checkDirectories = new(); + List collection; + const string pattern = @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]"; + string eDistanceCollectionDirectory = Path.Combine(Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(configuration, model, predictorModel, nameof(E_Distance), outputResolution, includeResizeGroup: true, includeModel: true, includePredictorModel: true), "[_]"); + Dictionary> keyValuePairs = Convert(argZero, propertyHolderCollections); + foreach (KeyValuePair> keyValuePair in keyValuePairs) + { + collection = new(); + checkDirectories.Clear(); + checkFile = string.Empty; + foreach ((string _, string personKey, D_Face face) in keyValuePair.Value) + { + if (string.IsNullOrEmpty(personKey) || !peopleCollection.ContainsKey(personKey)) + continue; + person = peopleCollection[personKey][0]; + directory = Path.Combine(eDistanceCollectionDirectory, $"{personKey}{keyValuePair.Key}"); + checkFile = Path.Combine(directory, Regex.Replace($"{Shared.Models.Stateless.Methods.IPersonName.GetFullName(person.Name)}.json", pattern, string.Empty)); + checkDirectories.Add(directory); + collection.Add(face); + } + if (!string.IsNullOrEmpty(checkFile) && checkDirectories.Any()) + { + foreach (string checkDirectory in checkDirectories) + { + if (!Directory.Exists(checkDirectory)) + _ = Directory.CreateDirectory(checkDirectory); + } + json = JsonSerializer.Serialize(collection, new JsonSerializerOptions { WriteIndented = true }); + _ = Property.Models.Stateless.IPath.WriteAllText(checkFile, json, compareBeforeWrite: true); + } + } + } + } \ No newline at end of file diff --git a/Property/Models/PropertyHolder.cs b/Property/Models/PropertyHolder.cs index d9d2c11..45ed659 100644 --- a/Property/Models/PropertyHolder.cs +++ b/Property/Models/PropertyHolder.cs @@ -7,10 +7,12 @@ public class PropertyHolder protected readonly bool? _Abandoned; protected readonly bool? _Changed; + protected object? _Face; protected FileInfo? _ImageFileInfo; protected readonly int _G; protected DateTime? _MinimumDateTime; protected bool? _Moved; + protected List<(string Directory, string PersonKey, object Object)> _Named; protected readonly bool? _NoJson; protected A_Property? _Property; protected readonly int _R; @@ -22,11 +24,13 @@ public class PropertyHolder protected bool? _WrongYear; public bool? Abandoned => _Abandoned; public bool? Changed => _Changed; + public object? Face => _Face; public FileInfo? ImageFileInfo => _ImageFileInfo; public int G => _G; public DateTime? MinimumDateTime => _MinimumDateTime; public bool? Moved => _Moved; public bool? NoJson => _NoJson; + public List<(string Directory, string PersonKey, object Object)> Named => _Named; public A_Property? Property => _Property; public int R => _R; public string RelativePath => _RelativePath; @@ -39,9 +43,10 @@ public class PropertyHolder public PropertyHolder() { _G = -1; + _Named = new(); + _RelativePath = string.Empty; _SourceDirectory = string.Empty; _SourceDirectoryFile = string.Empty; - _RelativePath = string.Empty; _R = -1; } @@ -54,6 +59,7 @@ public class PropertyHolder _G = g; _Moved = moved; _NoJson = abandoned is null; + _Named = new(); _Property = property; _R = r; _RelativePath = relativePath; @@ -80,4 +86,6 @@ public class PropertyHolder public bool Any() => (_Abandoned.HasValue && _Abandoned.Value) || (_Changed.HasValue && _Changed.Value) || (_Moved.HasValue && _Moved.Value) || (_NoJson.HasValue && _NoJson.Value); + public void AddNamed(string directory, string personKey, object face) => _Named.Add(new(directory, personKey, face)); + } \ No newline at end of file