Force Single Image => Sorting

This commit is contained in:
2022-10-01 21:19:43 -07:00
parent 3899cf6b4c
commit 9b8e3bdf55
10 changed files with 376 additions and 283 deletions

View File

@ -1,4 +1,5 @@
using System.Text.Json;
using View_by_Distance.Distance.Models.Stateless;
using View_by_Distance.FaceRecognitionDotNet;
using View_by_Distance.Shared.Models;
@ -10,6 +11,7 @@ public partial class E_Distance
private readonly List<string> _Moved;
private readonly List<double?> _Debug;
private readonly List<string> _Renamed;
private readonly Serilog.ILogger? _Log;
private readonly bool _DistanceRenameToMatch;
private readonly double _FaceDistanceTolerance;
private readonly bool _DistanceMoveUnableToMatch;
@ -26,6 +28,7 @@ public partial class E_Distance
_AllMappedFaceFiles = new();
_AllMappedFaceFileNames = new();
_DuplicateMappedFaceFiles = new();
_Log = Serilog.Log.ForContext<E_Distance>();
_DistanceRenameToMatch = distanceRenameToMatch;
_FaceDistanceTolerance = faceDistanceTolerance;
_DistanceMoveUnableToMatch = distanceMoveUnableToMatch;
@ -438,8 +441,14 @@ public partial class E_Distance
public void Clear()
{
if (_Log is null)
throw new NullReferenceException(nameof(_Log));
double?[] debug = (from l in _Debug where l is null or not 0 select l).ToArray();
string debugMessage = $"{_Debug.Count - debug.Length} - {debug.Min()} - {_Debug.Max()}";
if (debug.Any())
{
string debugMessage = $"{_Debug.Count - debug.Length} - {debug.Min()} - {_Debug.Max()}";
_Log.Info(debugMessage);
}
if (_Moved.Any() || _Renamed.Any() || _DuplicateMappedFaceFiles.Any())
throw new NotImplementedException("Restart!");
_Debug.Clear();