Runs but broken
This commit is contained in:
@ -17,14 +17,16 @@ internal abstract class RelationLogic
|
||||
Dictionary<long, Dictionary<int, List<LocationContainer>>> personKeyTo = [];
|
||||
foreach (LocationContainer locationContainer in locationContainers)
|
||||
{
|
||||
if (locationContainer.PersonKey is null)
|
||||
continue;
|
||||
if (!locationContainer.FromDistanceContent)
|
||||
continue;
|
||||
if (!locationContainer.FilePath.FullName.Contains(configuration.LocationContainerDirectoryPattern))
|
||||
continue;
|
||||
if (!personKeyTo.TryGetValue(locationContainer.PersonKey, out yearTo))
|
||||
if (!personKeyTo.TryGetValue(locationContainer.PersonKey.Value, out yearTo))
|
||||
{
|
||||
personKeyTo.Add(locationContainer.PersonKey, []);
|
||||
if (!personKeyTo.TryGetValue(locationContainer.PersonKey, out yearTo))
|
||||
personKeyTo.Add(locationContainer.PersonKey.Value, []);
|
||||
if (!personKeyTo.TryGetValue(locationContainer.PersonKey.Value, out yearTo))
|
||||
throw new Exception();
|
||||
}
|
||||
if (!yearTo.TryGetValue(locationContainer.CreationDateOnly.Year, out collection))
|
||||
@ -45,6 +47,7 @@ internal abstract class RelationLogic
|
||||
int lastIndex;
|
||||
List<int> years = [];
|
||||
List<int> indices = [];
|
||||
LocationContainer locationContainer;
|
||||
List<(int Index, int Year)> sort = [];
|
||||
List<LocationContainer> collection = [];
|
||||
KeyValuePair<int, List<LocationContainer>> keyValue;
|
||||
@ -76,7 +79,10 @@ internal abstract class RelationLogic
|
||||
key = $"{years.Min()}-{keyValue.Key}";
|
||||
if (collection.Count == 0)
|
||||
continue;
|
||||
results.Add(new(key, collection[0].PersonKey, new(collection)));
|
||||
locationContainer = collection[0];
|
||||
if (locationContainer.PersonKey is null)
|
||||
continue;
|
||||
results.Add(new(key, locationContainer.PersonKey.Value, new(collection)));
|
||||
collection = [];
|
||||
years.Clear();
|
||||
}
|
||||
@ -254,7 +260,7 @@ internal abstract class RelationLogic
|
||||
_ = Directory.CreateDirectory(vsCodeDirectory);
|
||||
if (displayDirectoryName is not null)
|
||||
File.WriteAllText(Path.Combine(directory, $"_ {displayDirectoryName}.txt"), string.Empty);
|
||||
json = "{ \"[markdown]\": { \"editor.wordWrap\": \"off\" }, \"foam.links.hover.enable\": false, \"foam.graph.style\": { \"background\": \"#202020\", \"node\": { \"note\": \"#f2cb1d\", \"distance\": \"green\", \"image\": \"orange\", \"placeholder\": \"white\", } } }";
|
||||
json = /*lang=json*/ """{ "[markdown]": { "editor.wordWrap": "off" }, "foam.links.hover.enable": false, "foam.graph.style": { "background": "#202020", "node": { "note": "#f2cb1d", "distance": "green", "image": "orange", "placeholder": "white", } } }""";
|
||||
_ = IPath.WriteAllText(Path.Combine(vsCodeDirectory, "settings.json"), json, updateDateWhenMatches: false, compareBeforeWrite: true, updateToWhenMatches: null);
|
||||
json = string.Concat("{ \"version\": \"2.0.0\", \"tasks\": [ { \"label\": \"MKLink\", \"type\": \"shell\", \"command\": \"New-Item\", \"args\": [ \"-ItemType\", \"Junction\", \"-Path\", \"'", directory.Replace('\\', '/'), "/()'\", \"-Target\", \"'", eDistanceContentDirectory.Replace('\\', '/'), "'\" ], \"problemMatcher\": [] } ] }");
|
||||
_ = IPath.WriteAllText(Path.Combine(vsCodeDirectory, "tasks.json"), json, updateDateWhenMatches: false, compareBeforeWrite: true, updateToWhenMatches: null);
|
||||
@ -422,7 +428,7 @@ internal abstract class RelationLogic
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
WriteVsCodeFiles(eDistanceContentDirectory, displayDirectoryName, directory);
|
||||
relationContainers = distance.GetRelationContainers(configuration.FaceDistancePermyriad, configuration.LocationContainerDistanceTake, configuration.LocationContainerDistanceTolerance.Value, group.RelationContainersCollection);
|
||||
relationContainers = distance.GetRelationContainers(configuration.DistanceLimits, configuration.FaceDistancePermyriad, configuration.LocationContainerDistanceTake, configuration.LocationContainerDistanceTolerance.Value, group.RelationContainersCollection);
|
||||
movedFiles = GetMoveFiles(configuration, group.Key, take, isCounterPersonYear, displayDirectoryName, relationContainers);
|
||||
WriteFile(take, group.PersonKey, isCounterPersonYear, personKeyFormatted, displayDirectoryName, directory, ticks, uri, relationContainers, movedFiles);
|
||||
}
|
||||
|
Reference in New Issue
Block a user