Removed Rectangle from LocationContainer
mapped-ids-then-whole-percentages-to-location-container save-extracted-face save-extracted-java-script-object-notation
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
@ -10,22 +11,35 @@ public record LocationContainer(DateOnly? CreationDateOnly,
|
||||
int? LengthPermyriad,
|
||||
FilePath? LengthSource,
|
||||
PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName? PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName,
|
||||
RectangleF? Rectangle,
|
||||
int? WholePercentages)
|
||||
{
|
||||
|
||||
public static LocationContainer Get(LocationContainer locationContainer, object? encoding, bool keepExifDirectory)
|
||||
public string GetWithoutEncoding()
|
||||
{
|
||||
string result;
|
||||
WithoutEncoding withoutEncoding = new(CreationDateOnly: CreationDateOnly,
|
||||
ExifDirectory: ExifDirectory,
|
||||
FaceFile: FaceFile,
|
||||
FilePath: FilePath,
|
||||
LengthPermyriad: LengthPermyriad,
|
||||
LengthSource: LengthSource,
|
||||
PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName: PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName,
|
||||
WholePercentages: WholePercentages);
|
||||
result = JsonSerializer.Serialize(withoutEncoding, WithoutEncodingSourceGenerationContext.Default.WithoutEncoding);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static LocationContainer Get(LocationContainer locationContainer, object? encoding)
|
||||
{
|
||||
LocationContainer result;
|
||||
result = new(CreationDateOnly: locationContainer.CreationDateOnly,
|
||||
ExifDirectory: keepExifDirectory ? locationContainer.ExifDirectory : null,
|
||||
ExifDirectory: locationContainer.ExifDirectory,
|
||||
Encoding: encoding,
|
||||
FaceFile: locationContainer.FaceFile,
|
||||
FilePath: locationContainer.FilePath,
|
||||
LengthPermyriad: locationContainer.LengthPermyriad,
|
||||
LengthSource: locationContainer.LengthSource,
|
||||
PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName: locationContainer.PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName,
|
||||
Rectangle: locationContainer.Rectangle,
|
||||
WholePercentages: locationContainer.WholePercentages);
|
||||
return result;
|
||||
}
|
||||
@ -41,9 +55,23 @@ public record LocationContainer(DateOnly? CreationDateOnly,
|
||||
LengthPermyriad: lengthPermyriad,
|
||||
LengthSource: source.FilePath,
|
||||
PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName: locationContainer.PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName,
|
||||
Rectangle: locationContainer.Rectangle,
|
||||
WholePercentages: locationContainer.WholePercentages);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal record WithoutEncoding(DateOnly? CreationDateOnly,
|
||||
ExifDirectory? ExifDirectory,
|
||||
FaceFile? FaceFile,
|
||||
FilePath FilePath,
|
||||
int? LengthPermyriad,
|
||||
FilePath? LengthSource,
|
||||
PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName? PersonKeyFormattedAndKeyTicksAndDisplayDirectoryName,
|
||||
int? WholePercentages);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(WithoutEncoding))]
|
||||
internal partial class WithoutEncodingSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user