LookForAbandoned,

DateTimeOriginalThenMinimumDateTime and IsNotUniqueAndNeedsReview
This commit is contained in:
2023-05-07 20:07:48 -07:00
parent 3d6e6ef713
commit 0ca53436e5
45 changed files with 721 additions and 1161 deletions

View File

@ -3,142 +3,6 @@ using System.Text.Json.Serialization;
namespace View_by_Distance.Shared.Models;
public class MappingFromItem : Properties.IMappingFromItem
{
public DateTime[] ContainerDateTimes { init; get; }
public int Id { init; get; }
public FileHolder ImageFileHolder { init; get; }
public bool? IsWrongYear { init; get; }
public DateTime MinimumDateTime { init; get; }
public string RelativePath { init; get; }
public FileHolder ResizedFileHolder { init; get; }
[JsonConstructor]
public MappingFromItem(DateTime[] containerDateTimes, int id, FileHolder imageFileHolder, bool? isWrongYear, DateTime minimumDateTime, string relativePath, FileHolder resizedFileHolder)
{
ContainerDateTimes = containerDateTimes;
Id = id;
ImageFileHolder = imageFileHolder;
IsWrongYear = isWrongYear;
MinimumDateTime = minimumDateTime;
RelativePath = relativePath;
ResizedFileHolder = resizedFileHolder;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
internal static MappingFromItem GetMappingFromItem(DateTime[] containerDateTimes, Item item, FileHolder? resizedFileHolder)
{
MappingFromItem result;
bool? isWrongYear;
DateTime minimumDateTime;
if (item.Property?.Id is null)
throw new NotSupportedException();
if (resizedFileHolder is null)
throw new NotSupportedException();
minimumDateTime = Stateless.Methods.IProperty.GetMinimumDateTime(item.Property);
(isWrongYear, _) = item.Property.IsWrongYear(item.ImageFileHolder, minimumDateTime);
result = new(containerDateTimes, item.Property.Id.Value, item.ImageFileHolder, isWrongYear, minimumDateTime, item.RelativePath, resizedFileHolder);
return result;
}
}
public class MappingFromLocation : Properties.IMappingFromLocation
{
public int AreaPermyriad { init; get; }
public int ConfidencePercent { init; get; }
public string DeterministicHashCodeKey { init; get; }
public int NormalizedRectangle { init; get; }
[JsonConstructor]
public MappingFromLocation(int areaPermyriad, int confidencePercent, string deterministicHashCodeKey, int normalizedRectangle)
{
AreaPermyriad = areaPermyriad;
ConfidencePercent = confidencePercent;
DeterministicHashCodeKey = deterministicHashCodeKey;
NormalizedRectangle = normalizedRectangle;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}
public class MappingFromFilter : Properties.IMappingFromFilter
{
public bool? IsFocusModel { init; get; }
public bool? IsFocusRelativePath { init; get; }
public bool? IsIgnoreRelativePath { init; get; }
public bool? InSkipCollection { init; get; }
[JsonConstructor]
public MappingFromFilter(bool? isFocusModel, bool? isFocusRelativePath, bool? isIgnoreRelativePath, bool? inSkipCollection)
{
IsFocusModel = isFocusModel;
IsFocusRelativePath = isFocusRelativePath;
IsIgnoreRelativePath = isIgnoreRelativePath;
InSkipCollection = inSkipCollection;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}
public class MappingFromPhotoPrism : Properties.IMappingFromPhotoPrism
{
public DatabaseFile DatabaseFile { init; get; }
public List<Marker> Markers { init; get; }
[JsonConstructor]
public MappingFromPhotoPrism(DatabaseFile databaseFile, List<Marker> markers)
{
DatabaseFile = databaseFile;
Markers = markers;
}
}
public class MappingFromPerson : Properties.IMappingFromPerson
{
public int? ApproximateYears { init; get; }
public string DisplayDirectoryName { init; get; }
public PersonBirthday PersonBirthday { init; get; }
public string SegmentB { init; get; }
[JsonConstructor]
public MappingFromPerson(int? approximateYears, string displayDirectoryName, PersonBirthday personBirthday, string segmentB)
{
ApproximateYears = approximateYears;
DisplayDirectoryName = displayDirectoryName;
PersonBirthday = personBirthday;
SegmentB = segmentB;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}
public class Mapping : Properties.IMapping
{