|
|
|
@ -37,8 +37,8 @@ internal abstract class MapLogic
|
|
|
|
|
string fileName;
|
|
|
|
|
string checkFile;
|
|
|
|
|
int? wholePercentages;
|
|
|
|
|
List<string> distinctFiles = new();
|
|
|
|
|
List<string> distinctFileName = new();
|
|
|
|
|
List<string> distinctFiles = [];
|
|
|
|
|
List<string> distinctFileName = [];
|
|
|
|
|
bool skipNotSkipDirectoriesAny = configuration.SkipNotSkipDirectories.Length > 0;
|
|
|
|
|
string[] checkDirectories = (from l in configuration.SkipNotSkipDirectories select Path.GetFullPath($"{a2PeopleSingletonDirectory}{l}")).ToArray();
|
|
|
|
|
foreach (PersonContainer personContainer in personContainers)
|
|
|
|
@ -69,13 +69,13 @@ internal abstract class MapLogic
|
|
|
|
|
if (!skipNotSkipDirectoriesAny || !checkDirectories.Any(l => distinctFile.StartsWith(l)))
|
|
|
|
|
{
|
|
|
|
|
if (!skipCollection.ContainsKey(id.Value))
|
|
|
|
|
skipCollection.Add(id.Value, new());
|
|
|
|
|
skipCollection.Add(id.Value, []);
|
|
|
|
|
skipCollection[id.Value].Add((distinctFile, wholePercentages.Value));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!skipNotSkipCollection.ContainsKey(id.Value))
|
|
|
|
|
skipNotSkipCollection.Add(id.Value, new());
|
|
|
|
|
skipNotSkipCollection.Add(id.Value, []);
|
|
|
|
|
skipNotSkipCollection[id.Value].Add((distinctFile, wholePercentages.Value));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -160,7 +160,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyCollection<Face> GetFaces(ReadOnlyCollection<Item> items)
|
|
|
|
|
{
|
|
|
|
|
List<Face> results = new();
|
|
|
|
|
List<Face> results = [];
|
|
|
|
|
foreach (Item item in items)
|
|
|
|
|
{
|
|
|
|
|
if (item.Property?.Id is null || item.ResizedFileHolder is null)
|
|
|
|
@ -183,10 +183,10 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static List<MappedFile> GetDisplayDirectoryAllFiles(string fileNameExtension, string personBirthdayFormat, ReadOnlyCollection<PersonContainer> personContainers)
|
|
|
|
|
{
|
|
|
|
|
List<MappedFile> results = new();
|
|
|
|
|
List<MappedFile> results = [];
|
|
|
|
|
string fileName;
|
|
|
|
|
string personKeyFormatted;
|
|
|
|
|
List<string> distinct = new();
|
|
|
|
|
List<string> distinct = [];
|
|
|
|
|
foreach (PersonContainer personContainer in personContainers)
|
|
|
|
|
{
|
|
|
|
|
if (personContainer.Key is null)
|
|
|
|
@ -242,7 +242,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static List<(string, long)> GetDirectoryAndTicksCollection(string[] jLinks, string personBirthdayFormat, string? rootDirectory)
|
|
|
|
|
{
|
|
|
|
|
List<(string, long)> results = new();
|
|
|
|
|
List<(string, long)> results = [];
|
|
|
|
|
string directory;
|
|
|
|
|
DateTime dateTime;
|
|
|
|
|
string[] personKeyDirectories;
|
|
|
|
@ -275,15 +275,15 @@ internal abstract class MapLogic
|
|
|
|
|
{
|
|
|
|
|
(long, PersonContainer)[] results;
|
|
|
|
|
const int zero = 0;
|
|
|
|
|
List<string> errors = new();
|
|
|
|
|
List<string> errors = [];
|
|
|
|
|
string newestPersonKeyFormatted;
|
|
|
|
|
List<(long PersonKey, PersonContainer PersonContainer)> collection = new();
|
|
|
|
|
List<(long PersonKey, PersonContainer PersonContainer)> collection = [];
|
|
|
|
|
foreach (PersonContainer personContainer in personContainers)
|
|
|
|
|
{
|
|
|
|
|
if (personContainer.Key is null)
|
|
|
|
|
continue;
|
|
|
|
|
if (!personKeyToPersonContainerCollection.ContainsKey(personContainer.Key.Value))
|
|
|
|
|
personKeyToPersonContainerCollection.Add(personContainer.Key.Value, new());
|
|
|
|
|
personKeyToPersonContainerCollection.Add(personContainer.Key.Value, []);
|
|
|
|
|
personKeyToPersonContainerCollection[personContainer.Key.Value].Add(personContainer);
|
|
|
|
|
newestPersonKeyFormatted = IPersonBirthday.GetFormatted(configuration.PersonBirthdayFormat, personContainer.Key.Value);
|
|
|
|
|
if (!personKeyFormattedToPersonContainer.ContainsKey(newestPersonKeyFormatted))
|
|
|
|
@ -303,7 +303,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static Dictionary<int, Dictionary<int, List<PersonContainer>>> GetAll(Configuration configuration, ReadOnlyDictionary<string, PersonContainer> personKeyFormattedToPersonContainer, ReadOnlyCollection<PersonKeyFormattedIdThenWholePercentages> personKeyFormattedIdThenWholePercentagesCollection)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, Dictionary<int, List<PersonContainer>>> results = new();
|
|
|
|
|
Dictionary<int, Dictionary<int, List<PersonContainer>>> results = [];
|
|
|
|
|
PersonBirthday? personBirthday;
|
|
|
|
|
PersonContainer? personContainer;
|
|
|
|
|
List<PersonContainer>? personContainers;
|
|
|
|
@ -319,13 +319,13 @@ internal abstract class MapLogic
|
|
|
|
|
throw new Exception();
|
|
|
|
|
if (!results.TryGetValue(personKeyFormattedIdThenWholePercentages.Id, out idTo))
|
|
|
|
|
{
|
|
|
|
|
results.Add(personKeyFormattedIdThenWholePercentages.Id, new());
|
|
|
|
|
results.Add(personKeyFormattedIdThenWholePercentages.Id, []);
|
|
|
|
|
if (!results.TryGetValue(personKeyFormattedIdThenWholePercentages.Id, out idTo))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
|
if (!idTo.TryGetValue(personKeyFormattedIdThenWholePercentages.WholePercentages, out personContainers))
|
|
|
|
|
{
|
|
|
|
|
idTo.Add(personKeyFormattedIdThenWholePercentages.WholePercentages, new());
|
|
|
|
|
idTo.Add(personKeyFormattedIdThenWholePercentages.WholePercentages, []);
|
|
|
|
|
if (!idTo.TryGetValue(personKeyFormattedIdThenWholePercentages.WholePercentages, out personContainers))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
@ -337,17 +337,17 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static ReadOnlyDictionary<int, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>> GetReadOnly(Dictionary<int, Dictionary<int, List<PersonContainer>>> idThenWholePercentagesToPersonContainerCollection)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>> results = new();
|
|
|
|
|
List<long> distinct = new();
|
|
|
|
|
Dictionary<int, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>> results = [];
|
|
|
|
|
List<long> distinct = [];
|
|
|
|
|
List<PersonContainer> personContainers;
|
|
|
|
|
Dictionary<int, ReadOnlyCollection<PersonContainer>> keyValuePairs;
|
|
|
|
|
foreach (KeyValuePair<int, Dictionary<int, List<PersonContainer>>> idTo in idThenWholePercentagesToPersonContainerCollection)
|
|
|
|
|
{
|
|
|
|
|
keyValuePairs = new();
|
|
|
|
|
keyValuePairs = [];
|
|
|
|
|
foreach (KeyValuePair<int, List<PersonContainer>> wholePercentagesTo in idThenWholePercentagesToPersonContainerCollection[idTo.Key])
|
|
|
|
|
{
|
|
|
|
|
distinct.Clear();
|
|
|
|
|
personContainers = new();
|
|
|
|
|
personContainers = [];
|
|
|
|
|
foreach (PersonContainer personContainer in wholePercentagesTo.Value)
|
|
|
|
|
{
|
|
|
|
|
if (personContainer.Key is null)
|
|
|
|
@ -365,7 +365,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static ReadOnlyDictionary<int, ReadOnlyDictionary<int, Mapping>> GetReadOnly(Dictionary<int, Dictionary<int, Mapping>> keyValuePairs)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, ReadOnlyDictionary<int, Mapping>> results = new();
|
|
|
|
|
Dictionary<int, ReadOnlyDictionary<int, Mapping>> results = [];
|
|
|
|
|
foreach (KeyValuePair<int, Dictionary<int, Mapping>> keyValuePair in keyValuePairs)
|
|
|
|
|
results.Add(keyValuePair.Key, new(keyValuePair.Value));
|
|
|
|
|
return new(results);
|
|
|
|
@ -373,13 +373,13 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static List<PersonContainer> GetNonSpecificPeopleCollection(Configuration configuration, long ticks, List<long> personKeys, ReadOnlyDictionary<long, int> personKeyToCount)
|
|
|
|
|
{
|
|
|
|
|
List<PersonContainer> results = new();
|
|
|
|
|
List<PersonContainer> results = [];
|
|
|
|
|
bool check;
|
|
|
|
|
long personKey;
|
|
|
|
|
int? approximateYears = null;
|
|
|
|
|
PersonBirthday personBirthday;
|
|
|
|
|
PersonContainer personContainer;
|
|
|
|
|
string[] personDisplayDirectoryAllFiles = Array.Empty<string>();
|
|
|
|
|
string[] personDisplayDirectoryAllFiles = [];
|
|
|
|
|
DateTime incrementDate = new(configuration.PersonBirthdayFirstYear, 1, 1);
|
|
|
|
|
long oneHour = new DateTime(1, 1, 1, 1, 0, 0).Ticks - new DateTime(1, 1, 1).Ticks;
|
|
|
|
|
for (int i = 0; i < int.MaxValue; i++)
|
|
|
|
@ -409,7 +409,7 @@ internal abstract class MapLogic
|
|
|
|
|
if (check)
|
|
|
|
|
continue;
|
|
|
|
|
personBirthday = IPersonBirthday.GetPersonBirthday(personKey + (oneHour * 2));
|
|
|
|
|
personContainer = new(approximateYears, new PersonBirthday[] { personBirthday }, personDisplayDirectoryAllFiles, configuration.MappingDefaultName, personKey);
|
|
|
|
|
personContainer = new(approximateYears, [personBirthday], personDisplayDirectoryAllFiles, configuration.MappingDefaultName, personKey);
|
|
|
|
|
results.Add(personContainer);
|
|
|
|
|
if (results.Count > 99)
|
|
|
|
|
break;
|
|
|
|
@ -431,12 +431,12 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static List<MappedFile> GetMappedFiles(Configuration configuration, ReadOnlyCollection<PersonContainer> personContainers, List<Record> records)
|
|
|
|
|
{
|
|
|
|
|
List<MappedFile> results = new();
|
|
|
|
|
List<MappedFile> results = [];
|
|
|
|
|
string file;
|
|
|
|
|
long personKey;
|
|
|
|
|
string fileName;
|
|
|
|
|
string checkFile;
|
|
|
|
|
List<string> distinct = new();
|
|
|
|
|
List<string> distinct = [];
|
|
|
|
|
PersonBirthday? personBirthday;
|
|
|
|
|
results.AddRange(GetDisplayDirectoryAllFiles(configuration.FacesFileNameExtension, configuration.PersonBirthdayFormat, personContainers));
|
|
|
|
|
foreach (Record record in records)
|
|
|
|
@ -529,11 +529,11 @@ internal abstract class MapLogic
|
|
|
|
|
string key;
|
|
|
|
|
float? percent;
|
|
|
|
|
float itemPercentagesArea;
|
|
|
|
|
List<string> delete = new();
|
|
|
|
|
List<Duplicate> duplicates = new();
|
|
|
|
|
List<string> delete = [];
|
|
|
|
|
List<Duplicate> duplicates = [];
|
|
|
|
|
RectangleF? itemPercentagesRectangle;
|
|
|
|
|
(string File, int WholePercentages) item;
|
|
|
|
|
Dictionary<string, (string, int)> distinct = new();
|
|
|
|
|
Dictionary<string, (string, int)> distinct = [];
|
|
|
|
|
foreach (LocationContainer<MetadataExtractor.Directory> locationContainer in locationContainers)
|
|
|
|
|
{
|
|
|
|
|
key = string.Concat(locationContainer.PersonKey, locationContainer.Id);
|
|
|
|
@ -660,7 +660,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
private static List<(string, long)> GetJLinkResolvedDirectories(string personBirthdayFormat, List<string> resolvedDirectories)
|
|
|
|
|
{
|
|
|
|
|
List<(string, long)> results = new();
|
|
|
|
|
List<(string, long)> results = [];
|
|
|
|
|
DateTime dateTime;
|
|
|
|
|
string directoryName;
|
|
|
|
|
string[] directories;
|
|
|
|
@ -683,7 +683,7 @@ internal abstract class MapLogic
|
|
|
|
|
internal static void SetKeyValuePairsAndAddToCollections(Configuration configuration, ReadOnlyCollection<PersonContainer> personContainers, Dictionary<long, PersonContainer> personKeyToPersonContainer, ReadOnlyCollection<PersonKeyFormattedIdThenWholePercentages> personKeyFormattedIdThenWholePercentagesCollection, Dictionary<long, int> personKeyToCount, Dictionary<string, PersonContainer> personKeyFormattedToPersonContainer, Dictionary<long, List<PersonContainer>> personKeyToPersonContainerCollection, List<(PersonKeyFormattedIdThenWholePercentages, PersonContainer)> possiblyNewPersonDisplayDirectoryNamesAndPersonContainer)
|
|
|
|
|
{
|
|
|
|
|
PersonBirthday? personBirthday;
|
|
|
|
|
Dictionary<int, Dictionary<int, List<PersonContainer>>> idThenWholePercentagesToPersonContainers = new();
|
|
|
|
|
Dictionary<int, Dictionary<int, List<PersonContainer>>> idThenWholePercentagesToPersonContainers = [];
|
|
|
|
|
(long, PersonContainer)[] collection = GetDistinctCollection(configuration, personContainers, personKeyToPersonContainerCollection, personKeyFormattedToPersonContainer);
|
|
|
|
|
foreach ((long personKey, PersonContainer personContainer) in collection)
|
|
|
|
|
personKeyToPersonContainer.Add(personKey, personContainer);
|
|
|
|
@ -733,11 +733,11 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyCollection<PersonKeyFormattedIdThenWholePercentages> GetPersonKeyFormattedIdThenWholePercentages(Configuration configuration, long ticks, List<Record> collection)
|
|
|
|
|
{
|
|
|
|
|
List<PersonKeyFormattedIdThenWholePercentages> results = new();
|
|
|
|
|
List<PersonKeyFormattedIdThenWholePercentages> results = [];
|
|
|
|
|
int? id;
|
|
|
|
|
int? wholePercentages;
|
|
|
|
|
List<int> wholePercentagesCollection;
|
|
|
|
|
Dictionary<int, List<int>> idToWholePercentagesCollection = new();
|
|
|
|
|
Dictionary<int, List<int>> idToWholePercentagesCollection = [];
|
|
|
|
|
int totalSeconds = (int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds);
|
|
|
|
|
string message = $") {collection.Count:000} join from ticks Director(ies) - C - {totalSeconds} total second(s)";
|
|
|
|
|
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
|
|
|
@ -749,7 +749,7 @@ internal abstract class MapLogic
|
|
|
|
|
if (id is null || wholePercentages is null)
|
|
|
|
|
continue;
|
|
|
|
|
if (!idToWholePercentagesCollection.ContainsKey(id.Value))
|
|
|
|
|
idToWholePercentagesCollection.Add(id.Value, new());
|
|
|
|
|
idToWholePercentagesCollection.Add(id.Value, []);
|
|
|
|
|
wholePercentagesCollection = idToWholePercentagesCollection[id.Value];
|
|
|
|
|
wholePercentagesCollection.Add(wholePercentages.Value);
|
|
|
|
|
idToWholePercentagesCollection[id.Value].Add(wholePercentages.Value);
|
|
|
|
@ -760,9 +760,9 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static List<PersonContainer> GetNotMappedPersonContainers(Configuration configuration, long ticks, ReadOnlyCollection<PersonContainer> personContainers, ReadOnlyDictionary<long, int> personKeyToCount)
|
|
|
|
|
{
|
|
|
|
|
List<PersonContainer> results = new();
|
|
|
|
|
List<PersonContainer> notMappedAndNotNamedPersonKeys = new();
|
|
|
|
|
List<PersonContainer> notMappedAndWithNamedPersonKeys = new();
|
|
|
|
|
List<PersonContainer> results = [];
|
|
|
|
|
List<PersonContainer> notMappedAndNotNamedPersonKeys = [];
|
|
|
|
|
List<PersonContainer> notMappedAndWithNamedPersonKeys = [];
|
|
|
|
|
List<long> personKeys = IPersonContainer.GetPersonKeys(personContainers);
|
|
|
|
|
foreach (PersonContainer personContainer in personContainers)
|
|
|
|
|
{
|
|
|
|
@ -826,7 +826,7 @@ internal abstract class MapLogic
|
|
|
|
|
const int zero = 0;
|
|
|
|
|
string personKeyFormatted;
|
|
|
|
|
string[] deleteCollection;
|
|
|
|
|
List<string> distinct = new();
|
|
|
|
|
List<string> distinct = [];
|
|
|
|
|
PersonBirthday personBirthday;
|
|
|
|
|
string personDisplayDirectory;
|
|
|
|
|
DateTime dateTime = new(ticks);
|
|
|
|
@ -878,7 +878,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static List<LocationContainer<MetadataExtractor.Directory>> GetLocationContainers(int maxDegreeOfParallelism, Configuration configuration, long ticks, ReadOnlyCollection<PersonContainer> personContainers, Dictionary<int, List<(string, int)>> skipCollection, List<Record> records)
|
|
|
|
|
{
|
|
|
|
|
List<LocationContainer<MetadataExtractor.Directory>> results = new();
|
|
|
|
|
List<LocationContainer<MetadataExtractor.Directory>> results = [];
|
|
|
|
|
List<MappedFile> mappedFiles = GetMappedFiles(configuration, personContainers, records);
|
|
|
|
|
if (mappedFiles.Count > 0 && (configuration.DistanceMoveUnableToMatch || configuration.DistanceRenameToMatch))
|
|
|
|
|
{
|
|
|
|
@ -912,7 +912,7 @@ internal abstract class MapLogic
|
|
|
|
|
string checkDirectory;
|
|
|
|
|
string personKeyFormatted;
|
|
|
|
|
PersonBirthday personBirthday;
|
|
|
|
|
List<string> distinct = new();
|
|
|
|
|
List<string> distinct = [];
|
|
|
|
|
DateTime dateTime = new(ticks);
|
|
|
|
|
string by = nameof(Shared.Models.Stateless.IMapLogic.ManualCopy);
|
|
|
|
|
foreach (PersonContainer personContainer in personContainers)
|
|
|
|
@ -1005,7 +1005,7 @@ internal abstract class MapLogic
|
|
|
|
|
WindowsShortcut windowsShortcut;
|
|
|
|
|
string personDisplayDirectoryName;
|
|
|
|
|
(string, string)[] yearDirectoryNameCheck;
|
|
|
|
|
List<(string, string)> yearDirectoryNames = new();
|
|
|
|
|
List<(string, string)> yearDirectoryNames = [];
|
|
|
|
|
string[] personKeyDirectories = Directory.GetDirectories(mappingDirectory, "*", SearchOption.TopDirectoryOnly);
|
|
|
|
|
foreach (string personKeyDirectory in personKeyDirectories)
|
|
|
|
|
{
|
|
|
|
@ -1057,7 +1057,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyDictionary<int, List<long>> GetIdToPersonKeys(ReadOnlyDictionary<long, List<int>> personKeyToIds)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, List<long>> results = new();
|
|
|
|
|
Dictionary<int, List<long>> results = [];
|
|
|
|
|
List<long>? collection;
|
|
|
|
|
foreach (KeyValuePair<long, List<int>> keyValuePair in personKeyToIds)
|
|
|
|
|
{
|
|
|
|
@ -1065,7 +1065,7 @@ internal abstract class MapLogic
|
|
|
|
|
{
|
|
|
|
|
if (!results.TryGetValue(id, out collection))
|
|
|
|
|
{
|
|
|
|
|
results.Add(id, new());
|
|
|
|
|
results.Add(id, []);
|
|
|
|
|
if (!results.TryGetValue(id, out collection))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
@ -1079,7 +1079,7 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyDictionary<int, ReadOnlyDictionary<int, Mapping>> GetIdToWholePercentagesToFace(ReadOnlyCollection<Mapping> mappingCollection)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, Dictionary<int, Mapping>> results = new();
|
|
|
|
|
Dictionary<int, Dictionary<int, Mapping>> results = [];
|
|
|
|
|
Dictionary<int, Mapping>? keyValuePairs;
|
|
|
|
|
foreach (Mapping mapping in mappingCollection)
|
|
|
|
|
{
|
|
|
|
@ -1087,7 +1087,7 @@ internal abstract class MapLogic
|
|
|
|
|
continue;
|
|
|
|
|
if (!results.TryGetValue(mapping.MappingFromItem.Id, out keyValuePairs))
|
|
|
|
|
{
|
|
|
|
|
results.Add(mapping.MappingFromItem.Id, new());
|
|
|
|
|
results.Add(mapping.MappingFromItem.Id, []);
|
|
|
|
|
if (!results.TryGetValue(mapping.MappingFromItem.Id, out keyValuePairs))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
@ -1106,14 +1106,14 @@ internal abstract class MapLogic
|
|
|
|
|
int totalFiles = 0;
|
|
|
|
|
string checkDirectory;
|
|
|
|
|
WindowsShortcut windowsShortcut;
|
|
|
|
|
List<string> resolvedDirectories = new();
|
|
|
|
|
List<string> resolvedDirectories = [];
|
|
|
|
|
if (string.IsNullOrEmpty(genealogicalDataCommunicationFile))
|
|
|
|
|
results = GetDirectoryAndTicksCollection(jLinks, personBirthdayFormat, a2PeopleContentDirectory);
|
|
|
|
|
else
|
|
|
|
|
results = GetGenealogicalDataCommunicationDirectories(genealogicalDataCommunicationFile, jLinks, personBirthdayFormat);
|
|
|
|
|
if (results.Count == 0 || results.Count < jLinks.Length)
|
|
|
|
|
{
|
|
|
|
|
List<(string, string, string)> a2PeopleSingletonDirectories = new();
|
|
|
|
|
List<(string, string, string)> a2PeopleSingletonDirectories = [];
|
|
|
|
|
foreach (string directory in Directory.GetDirectories(a2PeopleSingletonDirectory, "*", SearchOption.AllDirectories))
|
|
|
|
|
a2PeopleSingletonDirectories.Add((directory, Path.GetFileName(directory), Path.GetFileName(directory).Split(personCharacters).First()));
|
|
|
|
|
foreach (string directoryName in jLinks)
|
|
|
|
@ -1144,7 +1144,7 @@ internal abstract class MapLogic
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
resolvedDirectories.Clear();
|
|
|
|
|
results = new();
|
|
|
|
|
results = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return results;
|
|
|
|
@ -1205,13 +1205,13 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyDictionary<int, List<int>> ConvertSkip(Dictionary<int, List<(string, int)>> skipCollection)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, List<int>> results = new();
|
|
|
|
|
Dictionary<int, List<int>> results = [];
|
|
|
|
|
List<int>? wholePercentagesCollection;
|
|
|
|
|
foreach (KeyValuePair<int, List<(string, int)>> keyValuePair in skipCollection)
|
|
|
|
|
{
|
|
|
|
|
if (!results.TryGetValue(keyValuePair.Key, out wholePercentagesCollection))
|
|
|
|
|
{
|
|
|
|
|
results.Add(keyValuePair.Key, new());
|
|
|
|
|
results.Add(keyValuePair.Key, []);
|
|
|
|
|
if (!results.TryGetValue(keyValuePair.Key, out wholePercentagesCollection))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
@ -1223,13 +1223,13 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyDictionary<int, List<int>> ConvertSkipNotSkip(Dictionary<int, List<(string, int)>> skipNotSkipCollection)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, List<int>> results = new();
|
|
|
|
|
Dictionary<int, List<int>> results = [];
|
|
|
|
|
List<int>? wholePercentagesCollection;
|
|
|
|
|
foreach (KeyValuePair<int, List<(string, int)>> keyValuePair in skipNotSkipCollection)
|
|
|
|
|
{
|
|
|
|
|
if (!results.TryGetValue(keyValuePair.Key, out wholePercentagesCollection))
|
|
|
|
|
{
|
|
|
|
|
results.Add(keyValuePair.Key, new());
|
|
|
|
|
results.Add(keyValuePair.Key, []);
|
|
|
|
|
if (!results.TryGetValue(keyValuePair.Key, out wholePercentagesCollection))
|
|
|
|
|
throw new Exception();
|
|
|
|
|
}
|
|
|
|
@ -1241,11 +1241,11 @@ internal abstract class MapLogic
|
|
|
|
|
|
|
|
|
|
internal static ReadOnlyDictionary<int, List<LocationContainer<MetadataExtractor.Directory>>> ConvertLocationContainers(List<LocationContainer<MetadataExtractor.Directory>> locationContainers)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, List<LocationContainer<MetadataExtractor.Directory>>> results = new();
|
|
|
|
|
Dictionary<int, List<LocationContainer<MetadataExtractor.Directory>>> results = [];
|
|
|
|
|
foreach (LocationContainer<MetadataExtractor.Directory> locationContainer in locationContainers)
|
|
|
|
|
{
|
|
|
|
|
if (!results.ContainsKey(locationContainer.Id))
|
|
|
|
|
results.Add(locationContainer.Id, new());
|
|
|
|
|
results.Add(locationContainer.Id, []);
|
|
|
|
|
results[locationContainer.Id].Add(locationContainer);
|
|
|
|
|
}
|
|
|
|
|
return new(results);
|
|
|
|
|