IEnumerable
Filtered => ValidImage GetMappings => if (face.FaceEncoding is null || face.Location is null || face.OutputResolution is null) PreFilter skip done Removed sort Better names break out RootAmazon FilteredOriginalImage DeleteContinueFiles AppSetting PreVerify Settings Tasks
This commit is contained in:
19
Shared/Models/Aggregations.cs
Normal file
19
Shared/Models/Aggregations.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Aggregations(
|
||||
[property: JsonPropertyName("allPeople")] IReadOnlyList<AllPerson> AllPeople,
|
||||
[property: JsonPropertyName("clusterId")] IReadOnlyList<ClusterId> ClusterId,
|
||||
[property: JsonPropertyName("location")] IReadOnlyList<LocationAmazon> Location,
|
||||
[property: JsonPropertyName("people")] IReadOnlyList<PersonAmazon> People,
|
||||
[property: JsonPropertyName("things")] IReadOnlyList<Thing> Things,
|
||||
[property: JsonPropertyName("time")] IReadOnlyList<Time> Time,
|
||||
[property: JsonPropertyName("type")] IReadOnlyList<Type> Type
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Aggregations))]
|
||||
public partial class AggregationsGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/AllPerson.cs
Normal file
15
Shared/Models/AllPerson.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record AllPerson(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(AllPerson))]
|
||||
public partial class AllPersonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/ClusterId.cs
Normal file
15
Shared/Models/ClusterId.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ClusterId(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ClusterId))]
|
||||
public partial class ClusterIdGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Container(string SourceDirectory, List<Item> Items)
|
||||
public record Container(string SourceDirectory, ReadOnlyCollection<Item> Items)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
|
20
Shared/Models/ContentProperties.cs
Normal file
20
Shared/Models/ContentProperties.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ContentProperties(
|
||||
[property: JsonPropertyName("contentDate")] DateTime ContentDate,
|
||||
[property: JsonPropertyName("contentSignatures")] IReadOnlyList<ContentSignature> ContentSignatures,
|
||||
[property: JsonPropertyName("contentType")] string ContentType,
|
||||
[property: JsonPropertyName("extension")] string Extension,
|
||||
[property: JsonPropertyName("image")] ImageAmazon Image,
|
||||
[property: JsonPropertyName("md5")] string Md5,
|
||||
[property: JsonPropertyName("size")] int Size,
|
||||
[property: JsonPropertyName("version")] int Version
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ContentProperties))]
|
||||
public partial class ContentPropertiesGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
14
Shared/Models/ContentSignature.cs
Normal file
14
Shared/Models/ContentSignature.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ContentSignature(
|
||||
[property: JsonPropertyName("contentSignature")] string Value,
|
||||
[property: JsonPropertyName("contentSignatureType")] string ContentSignatureType
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ContentSignature))]
|
||||
public partial class ContentSignatureGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
45
Shared/Models/Datum.cs
Normal file
45
Shared/Models/Datum.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Datum(
|
||||
[property: JsonPropertyName("accessRuleIds")] IReadOnlyList<object> AccessRuleIds,
|
||||
[property: JsonPropertyName("childAssetTypeInfo")] IReadOnlyList<object> ChildAssetTypeInfo,
|
||||
[property: JsonPropertyName("contentProperties")] ContentProperties ContentProperties,
|
||||
[property: JsonPropertyName("createdBy")] string CreatedBy,
|
||||
[property: JsonPropertyName("createdDate")] DateTime CreatedDate,
|
||||
[property: JsonPropertyName("eTagResponse")] string ETagResponse,
|
||||
[property: JsonPropertyName("groupPermissions")] IReadOnlyList<object> GroupPermissions,
|
||||
[property: JsonPropertyName("id")] string Id,
|
||||
[property: JsonPropertyName("isRoot")] bool IsRoot,
|
||||
[property: JsonPropertyName("isShared")] bool IsShared,
|
||||
[property: JsonPropertyName("keywords")] IReadOnlyList<object> Keywords,
|
||||
[property: JsonPropertyName("kind")] string Kind,
|
||||
[property: JsonPropertyName("labels")] IReadOnlyList<object> Labels,
|
||||
[property: JsonPropertyName("modifiedDate")] DateTime ModifiedDate,
|
||||
[property: JsonPropertyName("name")] string Name,
|
||||
[property: JsonPropertyName("ownerId")] string OwnerId,
|
||||
[property: JsonPropertyName("parentMap")] ParentMap ParentMap,
|
||||
[property: JsonPropertyName("parents")] IReadOnlyList<string> Parents,
|
||||
[property: JsonPropertyName("protectedFolder")] bool ProtectedFolder,
|
||||
[property: JsonPropertyName("restricted")] bool Restricted,
|
||||
[property: JsonPropertyName("status")] string Status,
|
||||
[property: JsonPropertyName("subKinds")] IReadOnlyList<object> SubKinds,
|
||||
[property: JsonPropertyName("transforms")] IReadOnlyList<string> Transforms,
|
||||
[property: JsonPropertyName("version")] int Version,
|
||||
[property: JsonPropertyName("xAccntParentMap")] XAccntParentMap XAccntParentMap,
|
||||
[property: JsonPropertyName("xAccntParents")] IReadOnlyList<object> XAccntParents,
|
||||
[property: JsonPropertyName("match")] bool? Match
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Datum))]
|
||||
public partial class DatumGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Dictionary<string, Datum>))]
|
||||
public partial class DictionaryDatumGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
36
Shared/Models/ImageAmazon.cs
Normal file
36
Shared/Models/ImageAmazon.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ImageAmazon(
|
||||
[property: JsonPropertyName("colorSpace")] string ColorSpace,
|
||||
[property: JsonPropertyName("dateTime")] DateTime DateTime,
|
||||
[property: JsonPropertyName("dateTimeDigitized")] DateTime DateTimeDigitized,
|
||||
[property: JsonPropertyName("dateTimeOriginal")] DateTime DateTimeOriginal,
|
||||
[property: JsonPropertyName("exposureMode")] string ExposureMode,
|
||||
[property: JsonPropertyName("exposureProgram")] string ExposureProgram,
|
||||
[property: JsonPropertyName("exposureTime")] string ExposureTime,
|
||||
[property: JsonPropertyName("flash")] string Flash,
|
||||
[property: JsonPropertyName("focalLength")] string FocalLength,
|
||||
[property: JsonPropertyName("height")] int Height,
|
||||
[property: JsonPropertyName("make")] string Make,
|
||||
[property: JsonPropertyName("meteringMode")] string MeteringMode,
|
||||
[property: JsonPropertyName("model")] string Model,
|
||||
[property: JsonPropertyName("orientation")] string Orientation,
|
||||
[property: JsonPropertyName("resolutionUnit")] string ResolutionUnit,
|
||||
[property: JsonPropertyName("sensingMethod")] string SensingMethod,
|
||||
[property: JsonPropertyName("sharpness")] string Sharpness,
|
||||
[property: JsonPropertyName("software")] string Software,
|
||||
[property: JsonPropertyName("subSecTime")] string SubSecTime,
|
||||
[property: JsonPropertyName("subSecTimeDigitized")] string SubSecTimeDigitized,
|
||||
[property: JsonPropertyName("subSecTimeOriginal")] string SubSecTimeOriginal,
|
||||
[property: JsonPropertyName("whiteBalance")] string WhiteBalance,
|
||||
[property: JsonPropertyName("width")] int Width,
|
||||
[property: JsonPropertyName("apertureValue")] string ApertureValue
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ImageAmazon))]
|
||||
public partial class ImageAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/LocationAmazon.cs
Normal file
15
Shared/Models/LocationAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record LocationAmazon(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(LocationAmazon))]
|
||||
public partial class LocationAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
17
Shared/Models/LocationInfo.cs
Normal file
17
Shared/Models/LocationInfo.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record LocationInfo(
|
||||
[property: JsonPropertyName("city")] string City,
|
||||
[property: JsonPropertyName("country")] string Country,
|
||||
[property: JsonPropertyName("countryIso3Code")] string CountryIso3Code,
|
||||
[property: JsonPropertyName("state")] string State,
|
||||
[property: JsonPropertyName("stateCode")] string StateCode
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(LocationInfo))]
|
||||
public partial class LocationInfoGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -5,6 +5,6 @@ namespace View_by_Distance.Shared.Models.Methods;
|
||||
public interface IDistance
|
||||
{
|
||||
|
||||
ReadOnlyCollection<RelationContainer> GetRelationContainers(int faceDistancePermyriad, int locationContainerDistanceTake, float locationContainerDistanceTolerance, ReadOnlyCollection<LocationContainer> locationContainers);
|
||||
ReadOnlyCollection<RelationContainer> GetRelationContainers(IDistanceLimits distanceLimits, int faceDistancePermyriad, int locationContainerDistanceTake, float locationContainerDistanceTolerance, ReadOnlyCollection<LocationContainer> locationContainers);
|
||||
|
||||
}
|
@ -9,6 +9,7 @@ public interface IDistanceLimits
|
||||
public double FaceDistancePermyriad { init; get; }
|
||||
public int SortingMaximumPerFaceShouldBeHigh { init; get; }
|
||||
public bool RangeDaysDeltaTargetLessThenUpper { init; get; }
|
||||
public double RangeDistanceToleranceUpperLimit { init; get; }
|
||||
|
||||
string GetCounts();
|
||||
void AddCounts(int days, int distance);
|
||||
|
13
Shared/Models/ParentMap.cs
Normal file
13
Shared/Models/ParentMap.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ParentMap(
|
||||
[property: JsonPropertyName("FOLDER")] IReadOnlyList<string> FOLDER
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ParentMap))]
|
||||
public partial class ParentMapGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/PersonAmazon.cs
Normal file
15
Shared/Models/PersonAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record PersonAmazon(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(PersonAmazon))]
|
||||
public partial class PersonAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/RootAmazon.cs
Normal file
15
Shared/Models/RootAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record RootAmazon(
|
||||
[property: JsonPropertyName("aggregations")] Aggregations Aggregations,
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("data")] IReadOnlyList<Datum> Data
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(RootAmazon))]
|
||||
public partial class RootAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
16
Shared/Models/SearchData.cs
Normal file
16
Shared/Models/SearchData.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record SearchData(
|
||||
[property: JsonPropertyName("clusterName")] string ClusterName,
|
||||
[property: JsonPropertyName("locationId")] string LocationId,
|
||||
[property: JsonPropertyName("locationInfo")] LocationInfo LocationInfo,
|
||||
[property: JsonPropertyName("thingId")] string ThingId
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(SearchData))]
|
||||
public partial class SearchDataGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -8,7 +8,7 @@ internal abstract class Container
|
||||
|
||||
private record FilePair(bool IsUnique, List<string> Collection, FilePath FilePath, Models.Item Item) { }
|
||||
|
||||
internal static DateTime[] GetContainerDateTimes(IEnumerable<Models.Item> items)
|
||||
internal static DateTime[] GetContainerDateTimes(ReadOnlyCollection<Models.Item> items)
|
||||
{
|
||||
DateTime[] results;
|
||||
long containerMinimumTicks = (from l in items select l.FilePath.LastWriteTicks).Min();
|
||||
@ -17,16 +17,16 @@ internal abstract class Container
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Models.Item[] GetFilterItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container)
|
||||
internal static ReadOnlyCollection<Models.Item> GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container)
|
||||
{
|
||||
List<Models.Item> results = [];
|
||||
foreach (Models.Item item in container.Items)
|
||||
{
|
||||
if (item.IsValidImageFormatExtension
|
||||
&& !propertyConfiguration.IgnoreExtensions.Contains(item.FilePath.ExtensionLowered))
|
||||
results.Add(item);
|
||||
if (!item.IsValidImageFormatExtension || propertyConfiguration.IgnoreExtensions.Contains(item.FilePath.ExtensionLowered))
|
||||
continue;
|
||||
results.Add(item);
|
||||
}
|
||||
return results.ToArray();
|
||||
return container.Items.Count == results.Count ? container.Items : new(results);
|
||||
}
|
||||
|
||||
internal static List<Models.FilePair> GetFilePairs(Properties.IPropertyConfiguration propertyConfiguration, string directorySearchFilter, string extension, string aPropertySingletonDirectory, ReadOnlyCollection<string[]> filesCollection)
|
||||
@ -74,8 +74,8 @@ internal abstract class Container
|
||||
bool abandoned = false;
|
||||
Models.FileHolder sourceDirectoryFileHolder;
|
||||
Models.Property? property = GetProperty(filePair);
|
||||
Models.FileHolder imageFileInfo = IFileHolder.Get(filePair.Path);
|
||||
FilePath filePath = FilePath.Get(propertyConfiguration, imageFileInfo, index: null);
|
||||
Models.FileHolder imageFileHolder = IFileHolder.Get(filePair.Path);
|
||||
FilePath filePath = FilePath.Get(propertyConfiguration, imageFileHolder, index: null);
|
||||
bool? fileSizeChanged = property is not null ? property.FileSize != filePath.Length : null;
|
||||
bool isValidImageFormatExtension = propertyConfiguration.ValidImageFormatExtensions.Contains(filePath.ExtensionLowered);
|
||||
if (property is not null && property.Keywords is not null)
|
||||
@ -85,8 +85,9 @@ internal abstract class Container
|
||||
bool shouldIgnore = propertyConfiguration.IgnoreRulesKeyWords.Any(l => property.Keywords.Contains(l));
|
||||
if (shouldIgnore)
|
||||
{
|
||||
if (shouldIgnore)
|
||||
{ }
|
||||
FileInfo fileInfo = new(filePath.FullName);
|
||||
if (!fileInfo.Attributes.HasFlag(FileAttributes.Hidden))
|
||||
File.SetAttributes(imageFileHolder.FullName, FileAttributes.Hidden);
|
||||
}
|
||||
if (filePath.IsIgnore.Value != shouldIgnore)
|
||||
{
|
||||
@ -169,7 +170,7 @@ internal abstract class Container
|
||||
{
|
||||
if (keyValuePair.Value.Count == 0)
|
||||
continue;
|
||||
container = new(keyValuePair.Key, keyValuePair.Value);
|
||||
container = new(keyValuePair.Key, new(keyValuePair.Value));
|
||||
results.Add(container);
|
||||
}
|
||||
return (filePairs.Count, results.ToArray());
|
||||
@ -199,13 +200,13 @@ internal abstract class Container
|
||||
internal static List<int> GetFilteredDistinctIds(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> readOnlyContainers)
|
||||
{
|
||||
List<int> results = [];
|
||||
Models.Item[] filteredItems;
|
||||
ReadOnlyCollection<Models.Item> filteredItems;
|
||||
foreach (Models.Container container in readOnlyContainers)
|
||||
{
|
||||
if (container.Items.Count == 0)
|
||||
continue;
|
||||
filteredItems = GetFilterItems(propertyConfiguration, container);
|
||||
if (filteredItems.Length == 0)
|
||||
filteredItems = GetValidImageItems(propertyConfiguration, container);
|
||||
if (filteredItems.Count == 0)
|
||||
continue;
|
||||
foreach (Models.Item item in filteredItems)
|
||||
{
|
||||
@ -219,11 +220,11 @@ internal abstract class Container
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static ReadOnlyCollection<Models.Item> GetItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems)
|
||||
internal static ReadOnlyCollection<Models.Item> GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems)
|
||||
{
|
||||
List<Models.Item> results = [];
|
||||
List<int> distinct = [];
|
||||
IEnumerable<Models.Item> filteredItems;
|
||||
ReadOnlyCollection<Models.Item> filteredItems;
|
||||
foreach (Models.Container container in containers)
|
||||
{
|
||||
if (container.Items.Count == 0)
|
||||
@ -232,8 +233,8 @@ internal abstract class Container
|
||||
filteredItems = container.Items;
|
||||
else
|
||||
{
|
||||
filteredItems = GetFilterItems(propertyConfiguration, container);
|
||||
if (!filteredItems.Any())
|
||||
filteredItems = GetValidImageItems(propertyConfiguration, container);
|
||||
if (filteredItems.Count == 0)
|
||||
continue;
|
||||
}
|
||||
foreach (Models.Item item in filteredItems)
|
||||
|
@ -5,15 +5,15 @@ namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
public interface IContainer
|
||||
{
|
||||
|
||||
DateTime[] TestStatic_GetContainerDateTimes(IEnumerable<Models.Item> items) =>
|
||||
DateTime[] TestStatic_GetContainerDateTimes(ReadOnlyCollection<Models.Item> items) =>
|
||||
GetContainerDateTimes(items);
|
||||
static DateTime[] GetContainerDateTimes(IEnumerable<Models.Item> items) =>
|
||||
static DateTime[] GetContainerDateTimes(ReadOnlyCollection<Models.Item> items) =>
|
||||
Container.GetContainerDateTimes(items);
|
||||
|
||||
Models.Item[] TestStatic_GetFilterItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container) =>
|
||||
GetFilterItems(propertyConfiguration, container);
|
||||
static Models.Item[] GetFilterItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container) =>
|
||||
Container.GetFilterItems(propertyConfiguration, container);
|
||||
ReadOnlyCollection<Models.Item> TestStatic_GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container) =>
|
||||
GetValidImageItems(propertyConfiguration, container);
|
||||
static ReadOnlyCollection<Models.Item> GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, Models.Container container) =>
|
||||
Container.GetValidImageItems(propertyConfiguration, container);
|
||||
|
||||
(int, Models.Container[]) TestStatic_GetContainers(Properties.IPropertyConfiguration propertyConfiguration, string aPropertySingletonDirectory) =>
|
||||
GetContainers(propertyConfiguration, aPropertySingletonDirectory);
|
||||
@ -30,9 +30,9 @@ public interface IContainer
|
||||
static List<int> GetFilteredDistinctIds(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> readOnlyContainers) =>
|
||||
Container.GetFilteredDistinctIds(propertyConfiguration, readOnlyContainers);
|
||||
|
||||
ReadOnlyCollection<Models.Item> TestStatic_GetItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems) =>
|
||||
GetItems(propertyConfiguration, containers, distinctItems, filterItems);
|
||||
static ReadOnlyCollection<Models.Item> GetItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems) =>
|
||||
Container.GetItems(propertyConfiguration, containers, distinctItems, filterItems);
|
||||
ReadOnlyCollection<Models.Item> TestStatic_GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems) =>
|
||||
GetValidImageItems(propertyConfiguration, containers, distinctItems, filterItems);
|
||||
static ReadOnlyCollection<Models.Item> GetValidImageItems(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<Models.Container> containers, bool distinctItems, bool filterItems) =>
|
||||
Container.GetValidImageItems(propertyConfiguration, containers, distinctItems, filterItems);
|
||||
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
public interface IPersonContainer
|
||||
@ -5,9 +7,9 @@ public interface IPersonContainer
|
||||
|
||||
// ...
|
||||
|
||||
List<long> TestStatic_GetPersonKeys(IEnumerable<Models.PersonContainer> personContainers) =>
|
||||
List<long> TestStatic_GetPersonKeys(ReadOnlyCollection<Models.PersonContainer> personContainers) =>
|
||||
GetPersonKeys(personContainers);
|
||||
static List<long> GetPersonKeys(IEnumerable<Models.PersonContainer> personContainers) =>
|
||||
static List<long> GetPersonKeys(ReadOnlyCollection<Models.PersonContainer> personContainers) =>
|
||||
PersonContainer.GetPersonKeys(personContainers);
|
||||
|
||||
List<Models.PersonContainer> TestStatic_GetPersonContainers(string a2PeopleSingletonDirectory, string personBirthdayFormat, char[] personCharacters, Properties.IPropertyConfiguration propertyConfiguration, string facesFileNameExtension) =>
|
||||
|
@ -43,9 +43,9 @@ public interface IProperty
|
||||
static List<DateTime> GetDateTimes(Models.Property property) =>
|
||||
Property.GetDateTimes(property.CreationTime, property.LastWriteTime, property.DateTime, property.DateTimeDigitized, property.DateTimeFromName, property.DateTimeOriginal, property.GPSDateStamp);
|
||||
|
||||
double TestStatic_GetStandardDeviation(IEnumerable<long> values, double average) =>
|
||||
double TestStatic_GetStandardDeviation(List<long> values, double average) =>
|
||||
GetStandardDeviation(values, average);
|
||||
static double GetStandardDeviation(IEnumerable<long> values, double average) =>
|
||||
static double GetStandardDeviation(List<long> values, double average) =>
|
||||
Property.GetStandardDeviation(values, average);
|
||||
|
||||
TimeSpan TestStatic_GetThreeStandardDeviationHigh(int minimum, Models.Container container) =>
|
||||
|
@ -1,3 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
internal abstract class PersonContainer
|
||||
@ -313,7 +315,7 @@ internal abstract class PersonContainer
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static List<long> GetPersonKeys(IEnumerable<Models.PersonContainer> personContainers)
|
||||
internal static List<long> GetPersonKeys(ReadOnlyCollection<Models.PersonContainer> personContainers)
|
||||
{
|
||||
List<long> results = [];
|
||||
long personKey;
|
||||
|
@ -166,13 +166,13 @@ internal abstract class Property
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static double GetStandardDeviation(IEnumerable<long> values, double average)
|
||||
internal static double GetStandardDeviation(List<long> values, double average)
|
||||
{
|
||||
double result = 0;
|
||||
if (!values.Any())
|
||||
if (values.Count == 0)
|
||||
throw new Exception("Collection must have at least one value!");
|
||||
double sum = values.Sum(l => (l - average) * (l - average));
|
||||
result = Math.Sqrt(sum / values.Count());
|
||||
result = Math.Sqrt(sum / values.Count);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
15
Shared/Models/Thing.cs
Normal file
15
Shared/Models/Thing.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Thing(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Thing))]
|
||||
public partial class ThingGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/Time.cs
Normal file
15
Shared/Models/Time.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Time(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Time))]
|
||||
public partial class TimeGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/Type.cs
Normal file
15
Shared/Models/Type.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Type(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Type))]
|
||||
public partial class TypeGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
13
Shared/Models/XAccntParentMap.cs
Normal file
13
Shared/Models/XAccntParentMap.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record XAccntParentMap(
|
||||
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(XAccntParentMap))]
|
||||
public partial class XAccntParentMapGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user