Rename
editorconfig
This commit is contained in:
@ -14,18 +14,18 @@ public class F_PhotoPrism
|
||||
{
|
||||
JsonProperty[] results;
|
||||
if (!File.Exists(fileName))
|
||||
results = Array.Empty<JsonProperty>();
|
||||
results = [];
|
||||
else
|
||||
{
|
||||
string json = File.ReadAllText(fileName);
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
|
||||
if (jsonElements is null || jsonElements.Length == 0)
|
||||
results = Array.Empty<JsonProperty>();
|
||||
results = [];
|
||||
else
|
||||
{
|
||||
JsonElement jsonElement = jsonElements.Last();
|
||||
if (jsonElement.ValueKind != JsonValueKind.Object)
|
||||
results = Array.Empty<JsonProperty>();
|
||||
results = [];
|
||||
else
|
||||
results = jsonElement.EnumerateObject().ToArray();
|
||||
}
|
||||
@ -47,7 +47,7 @@ public class F_PhotoPrism
|
||||
|
||||
private static Dictionary<string, List<Shared.Models.Marker>> GetFileUIdToMarkers(string fPhotoPrismSingletonDirectory)
|
||||
{
|
||||
Dictionary<string, List<Shared.Models.Marker>> results = new();
|
||||
Dictionary<string, List<Shared.Models.Marker>> results = [];
|
||||
string fileUid;
|
||||
Marker[]? markers = GetMarkers(fPhotoPrismSingletonDirectory);
|
||||
if (markers is null)
|
||||
@ -56,7 +56,7 @@ public class F_PhotoPrism
|
||||
{
|
||||
fileUid = HexStringToString(marker.FileUid);
|
||||
if (!results.ContainsKey(fileUid))
|
||||
results.Add(fileUid, new());
|
||||
results.Add(fileUid, []);
|
||||
results[fileUid].Add(Marker.Map(marker));
|
||||
}
|
||||
return results;
|
||||
@ -84,7 +84,7 @@ public class F_PhotoPrism
|
||||
results = null;
|
||||
else
|
||||
{
|
||||
results = new();
|
||||
results = [];
|
||||
DatabaseFile[]? databaseFiles = JsonSerializer.Deserialize<DatabaseFile[]>(jsonProperties.Last().Value);
|
||||
if (databaseFiles is null)
|
||||
results = null;
|
||||
@ -105,7 +105,7 @@ public class F_PhotoPrism
|
||||
if (results is null)
|
||||
{
|
||||
int id;
|
||||
results = new();
|
||||
results = [];
|
||||
string fileNameWithoutExtension;
|
||||
List<Shared.Models.Marker>? makers;
|
||||
MappingFromPhotoPrism mappingFromPhotoPrism;
|
||||
@ -124,12 +124,12 @@ public class F_PhotoPrism
|
||||
|
||||
if (!results.TryGetValue(id, out mappingFromPhotoPrismCollection))
|
||||
{
|
||||
results.Add(id, new());
|
||||
results.Add(id, []);
|
||||
if (!results.TryGetValue(id, out mappingFromPhotoPrismCollection))
|
||||
throw new Exception();
|
||||
}
|
||||
if (!fileUIdToMarkers.TryGetValue(databaseFile.FileUid, out makers))
|
||||
mappingFromPhotoPrism = new(databaseFile, new());
|
||||
mappingFromPhotoPrism = new(databaseFile, []);
|
||||
else
|
||||
mappingFromPhotoPrism = new(databaseFile, makers);
|
||||
mappingFromPhotoPrismCollection.Add(mappingFromPhotoPrism);
|
||||
@ -179,7 +179,7 @@ public class F_PhotoPrism
|
||||
int width, height;
|
||||
int? wholePercentages;
|
||||
RectangleF? prismRectangle;
|
||||
List<string> subjects = new();
|
||||
List<string> subjects = [];
|
||||
DateTime dateTime = new(ticks);
|
||||
int dlibLocationWholePercentages;
|
||||
StringBuilder stringBuilder = new();
|
||||
@ -188,7 +188,7 @@ public class F_PhotoPrism
|
||||
float rectangleIntersectMinimum = rectangleIntersectMinimums.Min();
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers;
|
||||
(MappingFromPhotoPrism MappingFromPhotoPrism, Shared.Models.Marker Marker, float Percent)[] sortedCollection;
|
||||
List<(MappingFromPhotoPrism MappingFromPhotoPrism, Shared.Models.Marker Marker, float Percent)> collection = new();
|
||||
List<(MappingFromPhotoPrism MappingFromPhotoPrism, Shared.Models.Marker Marker, float Percent)> collection = [];
|
||||
foreach (Face face in distinctFilteredFaces)
|
||||
{
|
||||
collection.Clear();
|
||||
|
Reference in New Issue
Block a user