Removed AddJsonFile
Removed appsettings Moved MoveToDecade
This commit is contained in:
parent
77d7e8f568
commit
a8b179cb0c
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
@ -7,6 +7,7 @@
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<UserSecretsId>7b153e3d-672b-4f7a-888a-cb31645a2439</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||
@ -42,15 +43,4 @@
|
||||
<ProjectReference Include="..\Resize\Resize.csproj" />
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Instance\appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Staging.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -43,7 +43,6 @@ public partial class DragDropSearch : Form
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<Program>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
|
@ -295,13 +295,15 @@ public partial class DlibDotNet
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SetMapping(MapLogic mapLogic, Item item, bool? isFocusRelativePath, bool? isIgnoreRelativePath, ReadOnlyCollection<LocationContainer<MetadataExtractor.Directory>> locationContainers, MappingFromItem mappingFromItem, List<MappingFromPhotoPrism>? mappingFromPhotoPrismCollection, List<Shared.Models.Face> faces)
|
||||
private int GetNotMappedCountAndSetMapping(MapLogic mapLogic, Item item, bool? isFocusRelativePath, bool? isIgnoreRelativePath, ReadOnlyCollection<LocationContainer<MetadataExtractor.Directory>> locationContainers, MappingFromItem mappingFromItem, List<MappingFromPhotoPrism>? mappingFromPhotoPrismCollection, List<Shared.Models.Face> faces)
|
||||
{
|
||||
int result;
|
||||
double? α;
|
||||
int? eyeα;
|
||||
bool? isUsed;
|
||||
bool? eyeReview;
|
||||
Mapping mapping;
|
||||
int notMapped = 0;
|
||||
bool? isFocusPerson;
|
||||
int confidencePercent;
|
||||
int faceAreaPermyriad;
|
||||
@ -312,9 +314,11 @@ public partial class DlibDotNet
|
||||
MappingFromLocation? mappingFromLocation;
|
||||
bool? isFocusModel = GetIsFocusModel(item.Property);
|
||||
bool ignoreXMatches = _JLinkResolvedDirectories.Count > 0;
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers;
|
||||
ReadOnlyCollection<string> locationContainersFiles = new((from l in locationContainers select l.File).ToArray());
|
||||
foreach (Shared.Models.Face face in faces)
|
||||
{
|
||||
wholePercentagesToPersonContainers = mapLogic.GetWholePercentagesToPersonContainers(item.Property?.Id);
|
||||
if (item.Property?.Id is null || face.FaceEncoding is null || face.Location is null || face.OutputResolution is null)
|
||||
{
|
||||
isUsed = null;
|
||||
@ -337,22 +341,25 @@ public partial class DlibDotNet
|
||||
wholePercentRectangle = Shared.Models.Stateless.Methods.ILocation.GetWholePercentages(face.Location, Shared.Models.Stateless.ILocation.Digits, face.OutputResolution);
|
||||
deterministicHashCodeKey = IMapping.GetDeterministicHashCodeKey(item.Property.Id.Value, face.Location, Shared.Models.Stateless.ILocation.Digits, face.OutputResolution);
|
||||
mappingFromLocation = new(faceAreaPermyriad, confidencePercent, deterministicHashCodeKey, eyeα, eyeReview, wholePercentRectangle);
|
||||
isUsed = mapLogic.IsUsed(ignoreXMatches, item.Property.Id.Value, mappingFromLocation);
|
||||
isUsed = mapLogic.IsUsed(ignoreXMatches, item.Property.Id.Value, wholePercentagesToPersonContainers, mappingFromLocation);
|
||||
inSkipCollection = mapLogic.InSkipCollection(item.Property.Id.Value, mappingFromLocation);
|
||||
isFocusPerson = mapLogic.IsFocusPerson(_Configuration.SkipPersonWithMoreThen, _JLinkResolvedDirectories, item.Property.Id.Value, mappingFromLocation);
|
||||
isFocusPerson = mapLogic.IsFocusPerson(_Configuration.SkipPersonWithMoreThen, _JLinkResolvedDirectories, wholePercentagesToPersonContainers, mappingFromLocation);
|
||||
mappingFromFilter = new(isFocusModel, isFocusPerson, isFocusRelativePath, isIgnoreRelativePath, inSkipCollection, isUsed);
|
||||
}
|
||||
mapping = new(mappingFromItem, mappingFromFilter, mappingFromLocation, mappingFromPhotoPrismCollection);
|
||||
_ = mapLogic.UpdateMappingFromPerson(locationContainersFiles, mapping);
|
||||
notMapped += mapLogic.UpdateMappingFromPerson(locationContainersFiles, wholePercentagesToPersonContainers, mapping);
|
||||
face.SetMapping(mapping);
|
||||
}
|
||||
result = notMapped;
|
||||
return result;
|
||||
}
|
||||
|
||||
private Mapping GetMapping(MapLogic mapLogic, Item item, bool? isFocusRelativePath, bool? isIgnoreRelativePath, MappingFromItem mappingFromItem)
|
||||
private (Mapping, int) GetMapping(MapLogic mapLogic, ReadOnlyCollection<string>? locationContainersFiles, Item item, bool? isFocusRelativePath, bool? isIgnoreRelativePath, MappingFromItem mappingFromItem)
|
||||
{
|
||||
Mapping result;
|
||||
bool? isUsed;
|
||||
int? eyeα = null;
|
||||
int notMapped = 0;
|
||||
bool? isFocusPerson;
|
||||
bool? eyeReview = null;
|
||||
bool? inSkipCollection;
|
||||
@ -364,6 +371,7 @@ public partial class DlibDotNet
|
||||
MappingFromLocation? mappingFromLocation;
|
||||
bool? isFocusModel = GetIsFocusModel(item.Property);
|
||||
bool ignoreXMatches = _JLinkResolvedDirectories.Count > 0;
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers = mapLogic.GetWholePercentagesToPersonContainers(item.Property?.Id);
|
||||
if (item.Property?.Id is null)
|
||||
{
|
||||
isUsed = null;
|
||||
@ -377,13 +385,14 @@ public partial class DlibDotNet
|
||||
wholePercentRectangle = Shared.Models.Stateless.Methods.ILocation.GetWholePercentages(Shared.Models.Stateless.ILocation.Digits);
|
||||
deterministicHashCodeKey = IMapping.GetDeterministicHashCodeKey(item.Property.Id.Value, Shared.Models.Stateless.ILocation.Digits);
|
||||
mappingFromLocation = new(faceAreaPermyriad, confidencePercent, deterministicHashCodeKey, eyeα, eyeReview, wholePercentRectangle);
|
||||
isUsed = mapLogic.IsUsed(ignoreXMatches, item.Property.Id.Value, mappingFromLocation);
|
||||
isUsed = mapLogic.IsUsed(ignoreXMatches, item.Property.Id.Value, wholePercentagesToPersonContainers, mappingFromLocation);
|
||||
inSkipCollection = mapLogic.InSkipCollection(item.Property.Id.Value, mappingFromLocation);
|
||||
isFocusPerson = mapLogic.IsFocusPerson(_Configuration.SkipPersonWithMoreThen, _JLinkResolvedDirectories, item.Property.Id.Value, mappingFromLocation);
|
||||
isFocusPerson = mapLogic.IsFocusPerson(_Configuration.SkipPersonWithMoreThen, _JLinkResolvedDirectories, wholePercentagesToPersonContainers, mappingFromLocation);
|
||||
mappingFromFilter = new(isFocusModel, isFocusPerson, isFocusRelativePath, isIgnoreRelativePath, inSkipCollection, isUsed);
|
||||
}
|
||||
result = new(mappingFromItem, mappingFromFilter, mappingFromLocation, mappingFromPhotoPrismCollection: null);
|
||||
return result;
|
||||
notMapped += mapLogic.UpdateMappingFromPerson(locationContainersFiles, wholePercentagesToPersonContainers, result);
|
||||
return (result, notMapped);
|
||||
}
|
||||
|
||||
private void LogItemPropertyIsNull(Item item)
|
||||
@ -408,7 +417,7 @@ public partial class DlibDotNet
|
||||
File.Move(item.ImageFileHolder.FullName, $"{item.ImageFileHolder.FullName}.rename");
|
||||
}
|
||||
|
||||
private void FullParallelForWork(A_Property propertyLogic,
|
||||
private int FullParallelForWork(A_Property propertyLogic,
|
||||
B_Metadata metadata,
|
||||
MapLogic mapLogic,
|
||||
string outputResolution,
|
||||
@ -426,6 +435,7 @@ public partial class DlibDotNet
|
||||
bool? isIgnoreRelativePath,
|
||||
string facePartsCollectionDirectory)
|
||||
{
|
||||
int result = 0;
|
||||
List<Shared.Models.Face> faces;
|
||||
long ticks = DateTime.Now.Ticks;
|
||||
DateTime dateTime = DateTime.Now;
|
||||
@ -502,7 +512,7 @@ public partial class DlibDotNet
|
||||
faces = _Faces.GetFaces(outputResolution, dResultsFullGroupDirectory, subFileTuples, parseExceptions, property, mappingFromItem, outputResolutionToResize, locationContainers, mappingFromPhotoPrismCollection);
|
||||
if (_AppSettings.MaxDegreeOfParallelism < 2)
|
||||
ticks = LogDelta(ticks, nameof(D_Face.GetFaces));
|
||||
SetMapping(mapLogic, item, isFocusRelativePath, isIgnoreRelativePath, locationContainers, mappingFromItem, mappingFromPhotoPrismCollection, faces);
|
||||
result = GetNotMappedCountAndSetMapping(mapLogic, item, isFocusRelativePath, isIgnoreRelativePath, locationContainers, mappingFromItem, mappingFromPhotoPrismCollection, faces);
|
||||
List<(Shared.Models.Face, FileInfo?, string, bool Saved)> faceCollection = _Faces.SaveFaces(_FaceParts.FileNameExtension, dResultsFullGroupDirectory, subFileTuples, parseExceptions, mappingFromItem, faces);
|
||||
if (_Configuration.CopyFacesAndSaveFaceLandmarkForOutputResolutions.Contains(outputResolution))
|
||||
_FaceParts.CopyFacesAndSaveFaceLandmarkImage(facePartsCollectionDirectory, mappingFromItem, faceCollection);
|
||||
@ -527,9 +537,10 @@ public partial class DlibDotNet
|
||||
item.Faces.AddRange(faces);
|
||||
sourceDirectoryChanges.AddRange(from l in subFileTuples where l.Item2 > dateTime select l);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private int FullParallelWork(int maxDegreeOfParallelism,
|
||||
private (int, bool) FullParallelWork(int maxDegreeOfParallelism,
|
||||
A_Property propertyLogic,
|
||||
B_Metadata metadata,
|
||||
MapLogic mapLogic,
|
||||
@ -546,7 +557,9 @@ public partial class DlibDotNet
|
||||
{
|
||||
if (_Log is null)
|
||||
throw new NullReferenceException(nameof(_Log));
|
||||
int result = 0;
|
||||
int notMapped = 0;
|
||||
int exceptionsCount = 0;
|
||||
bool exceptions = false;
|
||||
bool ignoreXMatches = _JLinkResolvedDirectories.Count > 0;
|
||||
ParallelOptions parallelOptions = new() { MaxDegreeOfParallelism = maxDegreeOfParallelism };
|
||||
DateTime[] containerDateTimes = Shared.Models.Stateless.Methods.IContainer.GetContainerDateTimes(filteredItems);
|
||||
@ -560,7 +573,7 @@ public partial class DlibDotNet
|
||||
{
|
||||
try
|
||||
{
|
||||
FullParallelForWork(propertyLogic,
|
||||
notMapped = FullParallelForWork(propertyLogic,
|
||||
metadata,
|
||||
mapLogic,
|
||||
outputResolution,
|
||||
@ -582,13 +595,15 @@ public partial class DlibDotNet
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result += 1;
|
||||
if (!exceptions)
|
||||
exceptions = true;
|
||||
exceptionsCount++;
|
||||
_Log.Error(string.Concat(container.SourceDirectory, Environment.NewLine, ex.Message, Environment.NewLine, ex.StackTrace), ex);
|
||||
if (result == filteredItems.Length)
|
||||
if (exceptionsCount == filteredItems.Length)
|
||||
throw new Exception(string.Concat("All in [", container.SourceDirectory, "] failed!"));
|
||||
}
|
||||
});
|
||||
return result;
|
||||
return (notMapped, exceptions);
|
||||
}
|
||||
|
||||
private static void WriteTab(string checkDirectory, List<(string Id, string Line)> metadataIdLines, string fileName)
|
||||
@ -678,14 +693,16 @@ public partial class DlibDotNet
|
||||
return new(cResultsFullGroupDirectory, c2ResultsFullGroupDirectory, dResultsFullGroupDirectory, d2ResultsFullGroupDirectory);
|
||||
}
|
||||
|
||||
private void FullDoWork(string argZero, string propertyRoot, long ticks, string aResultsFullGroupDirectory, string bResultsFullGroupDirectory, int t, Container[] containers, A_Property propertyLogic, B_Metadata metadata, Dictionary<int, List<MappingFromPhotoPrism>> fileNameToCollection, MapLogic mapLogic)
|
||||
private int FullDoWork(string argZero, string propertyRoot, long ticks, string aResultsFullGroupDirectory, string bResultsFullGroupDirectory, int t, Container[] containers, A_Property propertyLogic, B_Metadata metadata, Dictionary<int, List<MappingFromPhotoPrism>> fileNameToCollection, MapLogic mapLogic)
|
||||
{
|
||||
if (_Log is null)
|
||||
throw new NullReferenceException(nameof(_Log));
|
||||
int result = 0;
|
||||
int total;
|
||||
int notMapped;
|
||||
string message;
|
||||
bool exceptions;
|
||||
int totalSeconds;
|
||||
int exceptionCount;
|
||||
Container container;
|
||||
Item[] filteredItems;
|
||||
bool outputResolutionHasNumber;
|
||||
@ -724,7 +741,7 @@ public partial class DlibDotNet
|
||||
propertyLogic.SetAngleBracketCollection(aResultsFullGroupDirectory, container.SourceDirectory, anyNullOrNoIsUniqueFileName);
|
||||
if (outputResolutionHasNumber)
|
||||
_Resize.SetAngleBracketCollection(cResultsFullGroupDirectory, container.SourceDirectory);
|
||||
exceptionCount = FullParallelWork(maxDegreeOfParallelism,
|
||||
(notMapped, exceptions) = FullParallelWork(maxDegreeOfParallelism,
|
||||
propertyLogic,
|
||||
metadata,
|
||||
mapLogic,
|
||||
@ -738,7 +755,8 @@ public partial class DlibDotNet
|
||||
container,
|
||||
filteredItems,
|
||||
message);
|
||||
if (exceptionCount != 0)
|
||||
result += notMapped;
|
||||
if (exceptions)
|
||||
{
|
||||
_Exceptions.Add(container.SourceDirectory);
|
||||
continue;
|
||||
@ -756,6 +774,7 @@ public partial class DlibDotNet
|
||||
total += container.Items.Count;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SaveFaceDistances(long ticks, MapLogic mapLogic, Mapping[] mappingCollection, string dFacesContentDirectory, string d2FacePartsContentDirectory, string d2FacePartsContentCollectionDirectory, Dictionary<int, Dictionary<int, Mapping>> idToWholePercentagesToMapping, List<FaceDistance> faceDistanceEncodings, FaceDistanceContainer[] faceDistanceContainers)
|
||||
@ -887,11 +906,12 @@ public partial class DlibDotNet
|
||||
return result;
|
||||
}
|
||||
|
||||
private Mapping[] GetMappings(Property.Models.Configuration propertyConfiguration, Container[] containers, MapLogic mapLogic, bool distinctItems)
|
||||
private Mapping[] GetMappings(Property.Models.Configuration propertyConfiguration, Container[] containers, MapLogic mapLogic, int totalNotMapped, bool distinctItems)
|
||||
{
|
||||
Mapping[] results;
|
||||
int count = 0;
|
||||
Mapping mapping;
|
||||
int notMapped = 0;
|
||||
bool anyValidFaces;
|
||||
string focusRelativePath;
|
||||
bool? isFocusRelativePath;
|
||||
@ -901,6 +921,7 @@ public partial class DlibDotNet
|
||||
IEnumerable<Item> filteredItems;
|
||||
MappingFromItem mappingFromItem;
|
||||
List<Mapping> mappingCollection = new();
|
||||
ReadOnlyCollection<string>? locationContainersFiles = null;
|
||||
foreach (Container container in containers)
|
||||
{
|
||||
if (container.Items.Count == 0)
|
||||
@ -934,12 +955,21 @@ public partial class DlibDotNet
|
||||
}
|
||||
if (!anyValidFaces)
|
||||
{
|
||||
mapping = GetMapping(mapLogic, item, isFocusRelativePath, isIgnoreRelativePath, mappingFromItem);
|
||||
(mapping, notMapped) = GetMapping(mapLogic, locationContainersFiles, item, isFocusRelativePath, isIgnoreRelativePath, mappingFromItem);
|
||||
mappingCollection.Add(mapping);
|
||||
if (mapping.MappingFromPerson is null || mapping.MappingFromPerson.LocationContainersFiles.Count == 0)
|
||||
continue;
|
||||
if (_Configuration.LocationContainerDistanceTolerance is null)
|
||||
Map.Models.Stateless.Methods.IMapLogic.MoveToDecade(propertyConfiguration, mapping.MappingFromItem, mapping.MappingFromPerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
results = (from l in mappingCollection orderby l.MappingFromItem.Id select l).ToArray();
|
||||
if (notMapped != totalNotMapped)
|
||||
{
|
||||
if (notMapped != totalNotMapped)
|
||||
{ }
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@ -1179,7 +1209,7 @@ public partial class DlibDotNet
|
||||
B_Metadata metadata = new(_Configuration.PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, bResultsFullGroupDirectory);
|
||||
mapLogic ??= new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, _MapConfiguration, _Distance, personContainers, ticks, a2PeopleSingletonDirectory, eDistanceContentDirectory);
|
||||
containers = Shared.Models.Stateless.Methods.IContainer.SortContainers(_Configuration.PropertyConfiguration, _Configuration.IgnoreRelativePaths, _ArgZeroIsConfigurationRootDirectory, argZero, containers);
|
||||
FullDoWork(argZero, propertyRoot, ticks, aResultsFullGroupDirectory, bResultsFullGroupDirectory, t, containers, propertyLogic, metadata, fileNameToCollection, mapLogic);
|
||||
int totalNotMapped = FullDoWork(argZero, propertyRoot, ticks, aResultsFullGroupDirectory, bResultsFullGroupDirectory, t, containers, propertyLogic, metadata, fileNameToCollection, mapLogic);
|
||||
List<Item> distinctFilteredItems = Shared.Models.Stateless.Methods.IContainer.GetItems(_Configuration.PropertyConfiguration, containers, distinctItems: true, filterItems: true);
|
||||
if (_Configuration.LookForAbandoned)
|
||||
{
|
||||
@ -1192,8 +1222,7 @@ public partial class DlibDotNet
|
||||
_Distance.Clear();
|
||||
Verify(eDistanceContentDirectory, distinctFilteredItems);
|
||||
List<Shared.Models.Face> distinctFilteredFaces = Map.Models.Stateless.Methods.IMapLogic.GetFaces(distinctFilteredItems);
|
||||
Mapping[] distinctFilteredMappingCollection = GetMappings(_Configuration.PropertyConfiguration, containers, mapLogic, distinctItems: true);
|
||||
int totalNotMapped = mapLogic.UpdateMappingFromPerson(_Configuration.PropertyConfiguration, distinctFilteredMappingCollection);
|
||||
Mapping[] distinctFilteredMappingCollection = GetMappings(_Configuration.PropertyConfiguration, containers, mapLogic, totalNotMapped, distinctItems: true);
|
||||
string json = JsonSerializer.Serialize(distinctFilteredMappingCollection);
|
||||
File.WriteAllText(Path.Combine(eDistanceContentDirectory, $"{ticks}.json"), json);
|
||||
foreach (string outputResolution in _Configuration.OutputResolutions)
|
||||
|
@ -63,15 +63,4 @@
|
||||
<ProjectReference Include="..\Resize\Resize.csproj" />
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.Staging.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -18,8 +18,6 @@ public class Program
|
||||
IsEnvironment isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<Program>();
|
||||
IConfigurationRoot configurationRoot = configurationBuilder.Build();
|
||||
AppSettings appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Log4netProvider": "Debug"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": "Debug"
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1,206 +0,0 @@
|
||||
{
|
||||
"Company": "Mike Phares",
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 12,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"CheckDFaceAndUpWriteDates": false,
|
||||
"CheckJsonForDistanceResults": false,
|
||||
"CrossDirectoryMaxItemsInDistanceCollection": 7,
|
||||
"DateGroup": "DateGroup",
|
||||
"DeletePossibleDuplicates": false,
|
||||
"DistanceFactor": 8,
|
||||
"DistanceMoveUnableToMatch": false,
|
||||
"DistancePixelDistanceTolerance": 1,
|
||||
"DistanceRenameToMatch": false,
|
||||
"EyeThreshold": 33,
|
||||
"FaceAreaPermyriad": 10000,
|
||||
"FaceDistanceHiddenImageFactor": 2,
|
||||
"FaceConfidencePercent": 100,
|
||||
"FaceDistancePermyriad": 10000,
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForceFaceLastWriteTimeToCreationTime": false,
|
||||
"ForceMetadataLastWriteTimeToCreationTime": false,
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"ForceResizeLastWriteTimeToCreationTime": false,
|
||||
"FocusDirectory": "",
|
||||
"FocusModel": "",
|
||||
"GenealogicalDataCommunicationFile": "",
|
||||
"LoadPhotoPrismLocations": false,
|
||||
"LocationDigits": 9,
|
||||
"LocationFactor": 10000,
|
||||
"LookForAbandoned": true,
|
||||
"MappingDefaultName": "John Doe~25",
|
||||
"MappingUseDeterministicHashCodeUnknownFaceKeyValuePairsForAddToMapping": false,
|
||||
"MappingUseDeterministicHashCodeUnknownFaceKeyValuePairsForSaveMapping": false,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||
"ModelDirectory": "C:/GitHub/dlib-models",
|
||||
"ModelName": "Hog",
|
||||
"NumberOfJitters": 0,
|
||||
"NumberOfTimesToUpsample": 0,
|
||||
"OutputExtension": ".jpg",
|
||||
"OutputQuality": 95,
|
||||
"OverrideForFaceImages": false,
|
||||
"OverrideForFaceLandmarkImages": false,
|
||||
"OverrideForResizeImages": false,
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PersonBirthdayFirstYear": 1500,
|
||||
"PersonBirthdayFormat": "yyyy-MM-dd_HH",
|
||||
"PersonCharacters": "!#%]^_`~+=",
|
||||
"PersonCharactersCopyCount": 0,
|
||||
"PersonKeyFormat": "yyyy-MM-dd_HH",
|
||||
"PopulatePropertyId": true,
|
||||
"PredictorModelName": "Large",
|
||||
"PropertiesChangedForDistance": false,
|
||||
"PropertiesChangedForFaces": false,
|
||||
"PropertiesChangedForIndex": false,
|
||||
"PropertiesChangedForMetadata": false,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"PropertiesChangedForResize": false,
|
||||
"ResultAllInOne": "_ _ _",
|
||||
"ResultAllInOneSubdirectoryLength": 2,
|
||||
"ResultCollection": "[]",
|
||||
"ResultContent": "()",
|
||||
"ResultSingleton": "{}",
|
||||
"Reverse": false,
|
||||
"RootDirectory": "D:/Images",
|
||||
"SaveIndividually": false,
|
||||
"SaveFullYearOfRandomFiles": true,
|
||||
"SaveResizedSubFiles": true,
|
||||
"SaveSortingWithoutPerson": false,
|
||||
"SkipOlderThanDays": null,
|
||||
"SkipSearch": false,
|
||||
"SortingMaximumPerFaceShouldBeHigh": 3000,
|
||||
"SortingMaximumPerKey": 7,
|
||||
"SortingMinimumToUseSigma": 10,
|
||||
"TestDistanceResults": true,
|
||||
"UseFilterTries": 0,
|
||||
"CopyFacesAndSaveFaceLandmarkForOutputResolutions": [],
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF",
|
||||
".json",
|
||||
".JOSN",
|
||||
".txt",
|
||||
".TXT",
|
||||
".ico",
|
||||
".ICO"
|
||||
],
|
||||
"JLinks": [],
|
||||
"LoadOrCreateThenSaveDistanceResultsForOutputResolutions": [],
|
||||
"LoadOrCreateThenSaveImageFacesResultsForOutputResolutions": [],
|
||||
"OutputResolutions": [],
|
||||
"PropertyContentCollectionFiles": [],
|
||||
"RangeDaysDeltaTolerance": [
|
||||
0,
|
||||
700,
|
||||
123456
|
||||
],
|
||||
"RangeDistanceTolerance": [
|
||||
0,
|
||||
0.4,
|
||||
0.6
|
||||
],
|
||||
"RangeFaceAreaTolerance": [
|
||||
0,
|
||||
0.001,
|
||||
1
|
||||
],
|
||||
"RangeFaceConfidence": [
|
||||
0,
|
||||
0.2,
|
||||
0.8
|
||||
],
|
||||
"RectangleIntersectMinimums": [
|
||||
0.99
|
||||
],
|
||||
"IgnoreRelativePaths": [],
|
||||
"MixedYearRelativePaths": [],
|
||||
"SaveFaceDistancesForOutputResolutions": [],
|
||||
"SaveFaceLandmarkForOutputResolutions": [],
|
||||
"SaveFilteredOriginalImagesFromJLinksForOutputResolutions": [],
|
||||
"SaveMappedForOutputResolutions": [],
|
||||
"SaveRandomForOutputResolutions": [],
|
||||
"SaveShortcutsForOutputResolutions": [],
|
||||
"SkipNotSkipDirectories": [],
|
||||
"VerifyToSeason": [],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF",
|
||||
".tif",
|
||||
".TIF"
|
||||
],
|
||||
"ValidResolutions": [
|
||||
"Original",
|
||||
"176 x 176",
|
||||
"256 x 256",
|
||||
"353 x 353",
|
||||
"1024 x 768",
|
||||
"1280 x 720",
|
||||
"1280 x 800",
|
||||
"1376 x 768",
|
||||
"1600 x 1200",
|
||||
"1920 x 1080",
|
||||
"2256 x 1496",
|
||||
"3840 x 2160",
|
||||
"7680 x 4320"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -178,7 +178,7 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
return new(result, wholePercentagesToPersonContainers);
|
||||
}
|
||||
|
||||
public int UpdateMappingFromPerson(ReadOnlyCollection<string>? locationContainersFiles, Mapping mapping)
|
||||
public int UpdateMappingFromPerson(ReadOnlyCollection<string>? locationContainersFiles, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers, Mapping mapping)
|
||||
{
|
||||
int result = 0;
|
||||
long personKey;
|
||||
@ -186,18 +186,22 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
string mappingSegmentB;
|
||||
PersonBirthday personBirthday;
|
||||
ReadOnlyCollection<PersonContainer>? personContainers;
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers;
|
||||
for (int i = 1; i < 2; i++)
|
||||
{
|
||||
if (mapping.MappingFromLocation is null)
|
||||
continue;
|
||||
if (!_IdThenWholePercentagesToPersonContainers.TryGetValue(mapping.MappingFromItem.Id, out wholePercentagesToPersonContainers))
|
||||
if (wholePercentagesToPersonContainers is not null)
|
||||
{
|
||||
if (mapping.MappingFromFilter.InSkipCollection is not null && mapping.MappingFromFilter.InSkipCollection.Value)
|
||||
continue;
|
||||
result += 1;
|
||||
continue;
|
||||
}
|
||||
if (wholePercentagesToPersonContainers is null)
|
||||
{
|
||||
result += 1;
|
||||
continue;
|
||||
}
|
||||
if (!wholePercentagesToPersonContainers.TryGetValue(mapping.MappingFromLocation.WholePercentages, out personContainers))
|
||||
{
|
||||
if (mapping.MappingFromFilter.InSkipCollection is not null && mapping.MappingFromFilter.InSkipCollection.Value)
|
||||
@ -225,23 +229,6 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
return result;
|
||||
}
|
||||
|
||||
public int UpdateMappingFromPerson(Property.Models.Configuration propertyConfiguration, Mapping[] mappingCollection)
|
||||
{
|
||||
int result = 0;
|
||||
ReadOnlyCollection<string>? locationContainersFiles = null;
|
||||
foreach (Mapping mapping in mappingCollection)
|
||||
{
|
||||
if (mapping.MappingFromLocation is null)
|
||||
continue;
|
||||
result += UpdateMappingFromPerson(locationContainersFiles, mapping);
|
||||
if (mapping.MappingFromPerson is null || mapping.MappingFromPerson.LocationContainersFiles.Count == 0)
|
||||
continue;
|
||||
if (_Configuration?.LocationContainerDistanceTolerance is null)
|
||||
Stateless.MapLogic.MoveToDecade(propertyConfiguration, mapping.MappingFromItem, mapping.MappingFromPerson);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SaveContainers(bool saveIndividually, int totalNotMapped, int? updated, List<SaveContainer> saveContainers)
|
||||
{
|
||||
if (_Configuration is null)
|
||||
@ -1369,14 +1356,23 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
return results;
|
||||
}
|
||||
|
||||
public bool IsUsed(bool ignoreXMatches, int id, MappingFromLocation mappingFromLocation)
|
||||
public ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? GetWholePercentagesToPersonContainers(int? id)
|
||||
{
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? result;
|
||||
if (id is null)
|
||||
result = null;
|
||||
else
|
||||
_ = _IdThenWholePercentagesToPersonContainers.TryGetValue(id.Value, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool IsUsed(bool ignoreXMatches, int id, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers, MappingFromLocation mappingFromLocation)
|
||||
{
|
||||
bool result;
|
||||
List<int>? wholePercentagesCollection;
|
||||
ReadOnlyCollection<PersonContainer>? personContainers;
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers;
|
||||
result = _SkipCollection.TryGetValue(id, out wholePercentagesCollection) && wholePercentagesCollection.Contains(mappingFromLocation.WholePercentages);
|
||||
if (!result && _IdThenWholePercentagesToPersonContainers.TryGetValue(id, out wholePercentagesToPersonContainers))
|
||||
if (!result && wholePercentagesToPersonContainers is not null)
|
||||
{
|
||||
if (wholePercentagesToPersonContainers.TryGetValue(mappingFromLocation.WholePercentages, out personContainers))
|
||||
{
|
||||
@ -1390,14 +1386,13 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
public bool InSkipCollection(int id, MappingFromLocation mappingFromLocation) =>
|
||||
_SkipCollection.TryGetValue(id, out List<int>? wholePercentagesCollection) && wholePercentagesCollection.Contains(mappingFromLocation.WholePercentages);
|
||||
|
||||
public bool? IsFocusPerson(int? skipPersonWithMoreThen, List<(string Directory, long PersonKey)> jLinkResolvedDirectories, int id, MappingFromLocation mappingFromLocation)
|
||||
public bool? IsFocusPerson(int? skipPersonWithMoreThen, List<(string Directory, long PersonKey)> jLinkResolvedDirectories, ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers, MappingFromLocation mappingFromLocation)
|
||||
{
|
||||
bool? result;
|
||||
ReadOnlyCollection<PersonContainer>? personContainers;
|
||||
ReadOnlyDictionary<int, ReadOnlyCollection<PersonContainer>>? wholePercentagesToPersonContainers;
|
||||
if (skipPersonWithMoreThen is null && jLinkResolvedDirectories.Count == 0)
|
||||
result = null;
|
||||
else if (!_IdThenWholePercentagesToPersonContainers.TryGetValue(id, out wholePercentagesToPersonContainers))
|
||||
else if (wholePercentagesToPersonContainers is null)
|
||||
result = null;
|
||||
else if (!wholePercentagesToPersonContainers.TryGetValue(mappingFromLocation.WholePercentages, out personContainers))
|
||||
result = null;
|
||||
|
@ -33,4 +33,9 @@ public interface IMapLogic
|
||||
static List<(string, long)> GetJLinkDirectories(string genealogicalDataCommunicationFile, string[] jLinks, string personBirthdayFormat, char[] personCharacters, string a2PeopleSingletonDirectory, string a2PeopleContentDirectory) =>
|
||||
MapLogic.GetJLinkDirectories(genealogicalDataCommunicationFile, jLinks, personBirthdayFormat, personCharacters, a2PeopleSingletonDirectory, a2PeopleContentDirectory);
|
||||
|
||||
void TestStatic_MoveToDecade(Property.Models.Configuration propertyConfiguration, Shared.Models.MappingFromItem mappingFromItem, Shared.Models.MappingFromPerson mappingFromPerson) =>
|
||||
MoveToDecade(propertyConfiguration, mappingFromItem, mappingFromPerson);
|
||||
static void MoveToDecade(Property.Models.Configuration propertyConfiguration, Shared.Models.MappingFromItem mappingFromItem, Shared.Models.MappingFromPerson mappingFromPerson) =>
|
||||
MapLogic.MoveToDecade(propertyConfiguration, mappingFromItem, mappingFromPerson);
|
||||
|
||||
}
|
@ -51,12 +51,4 @@
|
||||
<ProjectReference Include="..\Resize\Resize.csproj" />
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Log4netProvider": "Debug"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": "Debug"
|
||||
}
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
{
|
||||
"ComparePathsFile": "",
|
||||
"Company": "Mike Phares",
|
||||
"ForceIdName": false,
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 6,
|
||||
"MaxMinutesDelta": 2,
|
||||
"RenameUndo": false,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Information",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"DateGroup": "dd514b88",
|
||||
"DiffPropertyDirectory": "",
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||
"OutputExtension": ".jpg",
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PersonBirthdayFormat": "yyyy-MM-dd_HH",
|
||||
"PopulatePropertyId": true,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"ResultAllInOne": "_ _ _",
|
||||
"ResultAllInOneSubdirectoryLength": 2,
|
||||
"ResultCollection": "[]",
|
||||
"ResultContent": "()",
|
||||
"ResultSingleton": "{}",
|
||||
"RootDirectory": "D:/Images",
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF",
|
||||
".nef",
|
||||
".NEF",
|
||||
".pdf",
|
||||
".PDF"
|
||||
],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF",
|
||||
".tif",
|
||||
".TIF"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -48,15 +48,4 @@
|
||||
<ProjectReference Include="..\Resize\Resize.csproj" />
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Instance\appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Staging.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -39,8 +39,6 @@ public partial class UnitTestCalculations
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestCalculations>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -36,8 +36,6 @@ public class UnitTestExample
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestExample>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -38,8 +38,6 @@ public partial class UnitTestHardCoded
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestHardCoded>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -41,8 +41,6 @@ public class UnitTestResize
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestResize>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -48,15 +48,4 @@
|
||||
<ProjectReference Include="..\FaceRecognitionDotNet\FaceRecognitionDotNet.csproj" />
|
||||
<ProjectReference Include="..\Property-Compare\Property-Compare.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Instance\appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Instance\appsettings.Staging.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -36,8 +36,6 @@ public class UnitTestExample
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestExample>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
@ -43,8 +43,6 @@ public class UnitTestFace
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true)
|
||||
.AddUserSecrets<UnitTestFace>();
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user