format
This commit is contained in:
parent
37b7ad2a1f
commit
d17b051da7
@ -21,7 +21,7 @@ public class DeleteByRelative
|
|||||||
string searchPattern = "*";
|
string searchPattern = "*";
|
||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
Configuration configuration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot);
|
Configuration configuration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot);
|
||||||
logger?.LogInformation(configuration.RootDirectory);
|
logger?.LogInformation(configuration.RootDirectory);
|
||||||
int length = configuration.RootDirectory.Length;
|
int length = configuration.RootDirectory.Length;
|
||||||
if (string.IsNullOrEmpty(appSettings.CompareRootDirectory) || Path.GetFullPath(appSettings.CompareRootDirectory) == Path.GetFullPath(configuration.RootDirectory))
|
if (string.IsNullOrEmpty(appSettings.CompareRootDirectory) || Path.GetFullPath(appSettings.CompareRootDirectory) == Path.GetFullPath(configuration.RootDirectory))
|
||||||
throw new Exception("Check AppSettings file!");
|
throw new Exception("Check AppSettings file!");
|
||||||
@ -59,14 +59,14 @@ public class DeleteByRelative
|
|||||||
File.WriteAllLines(deleteLog, deleteFiles);
|
File.WriteAllLines(deleteLog, deleteFiles);
|
||||||
if (deleteFiles.Count > 0)
|
if (deleteFiles.Count > 0)
|
||||||
{
|
{
|
||||||
logger?.LogInformation($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
|
logger?.LogInformation($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
|
||||||
for (int y = 0; y < int.MaxValue; y++)
|
for (int y = 0; y < int.MaxValue; y++)
|
||||||
{
|
{
|
||||||
logger?.LogInformation("Press \"Y\" key to delete file(s) or close console to not delete files");
|
logger?.LogInformation("Press \"Y\" key to delete file(s) or close console to not delete files");
|
||||||
if (Console.ReadKey().Key == ConsoleKey.Y)
|
if (Console.ReadKey().Key == ConsoleKey.Y)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger?.LogInformation(". . .");
|
logger?.LogInformation(". . .");
|
||||||
foreach (string deleteFile in deleteFiles)
|
foreach (string deleteFile in deleteFiles)
|
||||||
{
|
{
|
||||||
File.Delete(deleteFile);
|
File.Delete(deleteFile);
|
||||||
|
@ -34,7 +34,7 @@ public class MetadataQuery
|
|||||||
Configuration configuration = Models.Binder.Configuration.Get(isEnvironment, configurationRoot, propertyConfiguration);
|
Configuration configuration = Models.Binder.Configuration.Get(isEnvironment, configurationRoot, propertyConfiguration);
|
||||||
_PropertyConfiguration = propertyConfiguration;
|
_PropertyConfiguration = propertyConfiguration;
|
||||||
_Configuration = configuration;
|
_Configuration = configuration;
|
||||||
logger?.LogInformation(propertyConfiguration.RootDirectory);
|
logger?.LogInformation(propertyConfiguration.RootDirectory);
|
||||||
Verify();
|
Verify();
|
||||||
MetadataQueryFilesInDirectories(logger, ticks);
|
MetadataQueryFilesInDirectories(logger, ticks);
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ public class MetadataQuery
|
|||||||
private void MetadataQueryFilesInDirectories(ILogger<Program>? logger, long ticks)
|
private void MetadataQueryFilesInDirectories(ILogger<Program>? logger, long ticks)
|
||||||
{
|
{
|
||||||
List<(string FileName, string Count, string TagGroup, string TagIdName, string Value)> collection = GetCollection(ticks);
|
List<(string FileName, string Count, string TagGroup, string TagIdName, string Value)> collection = GetCollection(ticks);
|
||||||
logger?.LogInformation($"Ready to query {collection.Count} entries?");
|
logger?.LogInformation($"Ready to query {collection.Count} entries?");
|
||||||
IEnumerable<(string FileName, string Count, string TagGroup, string TagIdName, string Value)> enumerable()
|
IEnumerable<(string FileName, string Count, string TagGroup, string TagIdName, string Value)> enumerable()
|
||||||
{
|
{
|
||||||
foreach ((string FileName, string Count, string TagGroup, string TagIdName, string Value) l in collection)
|
foreach ((string FileName, string Count, string TagGroup, string TagIdName, string Value) l in collection)
|
||||||
|
@ -3,15 +3,15 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace View_by_Distance.Metadata.Models;
|
namespace View_by_Distance.Metadata.Models;
|
||||||
|
|
||||||
public record Avi(string? FramesPerSecond1,
|
public record Avi(string? FramesPerSecond1,
|
||||||
string? SamplesPerSecond2,
|
string? SamplesPerSecond2,
|
||||||
string? Duration3,
|
string? Duration3,
|
||||||
string? VideoCodec4,
|
string? VideoCodec4,
|
||||||
string? AudioCodec5,
|
string? AudioCodec5,
|
||||||
string? Width6,
|
string? Width6,
|
||||||
string? Height7,
|
string? Height7,
|
||||||
string? Streams8,
|
string? Streams8,
|
||||||
string? DateTimeOriginal320)
|
string? DateTimeOriginal320)
|
||||||
{
|
{
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -3,180 +3,180 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace View_by_Distance.Metadata.Models;
|
namespace View_by_Distance.Metadata.Models;
|
||||||
|
|
||||||
public record Exif(string? InteropIndex1,
|
public record Exif(string? InteropIndex1,
|
||||||
string? Noise37389,
|
string? Noise37389,
|
||||||
string? FocalPlaneXResolutionTiffEp37390,
|
string? FocalPlaneXResolutionTiffEp37390,
|
||||||
string? FocalPlaneYResolutionTiffEp37391,
|
string? FocalPlaneYResolutionTiffEp37391,
|
||||||
string? ImageNumber37393,
|
string? ImageNumber37393,
|
||||||
string? SecurityClassification37394,
|
string? SecurityClassification37394,
|
||||||
string? ImageHistory37395,
|
string? ImageHistory37395,
|
||||||
string? SubjectLocationTiffEp37396,
|
string? SubjectLocationTiffEp37396,
|
||||||
string? ExposureIndexTiffEp37397,
|
string? ExposureIndexTiffEp37397,
|
||||||
string? SpatialFreqResponseTiffEp37388,
|
string? SpatialFreqResponseTiffEp37388,
|
||||||
string? StandardIdTiffEp37398,
|
string? StandardIdTiffEp37398,
|
||||||
string? UserComment37510,
|
string? UserComment37510,
|
||||||
string? SubsecondTime37520,
|
string? SubsecondTime37520,
|
||||||
string? SubsecondTimeOriginal37521,
|
string? SubsecondTimeOriginal37521,
|
||||||
string? SubsecondTimeDigitized37522,
|
string? SubsecondTimeDigitized37522,
|
||||||
string? WinTitle40091,
|
string? WinTitle40091,
|
||||||
string? WinComment40092,
|
string? WinComment40092,
|
||||||
string? WinAuthor40093,
|
string? WinAuthor40093,
|
||||||
string? WinKeywords40094,
|
string? WinKeywords40094,
|
||||||
string? Makernote37500,
|
string? Makernote37500,
|
||||||
string? WinSubject40095,
|
string? WinSubject40095,
|
||||||
string? FlashEnergyTiffEp37387,
|
string? FlashEnergyTiffEp37387,
|
||||||
string? Flash37385,
|
string? Flash37385,
|
||||||
string? IsoSpeedLatitudeYYY34868,
|
string? IsoSpeedLatitudeYYY34868,
|
||||||
string? IsoSpeedLatitudeZZZ34869,
|
string? IsoSpeedLatitudeZZZ34869,
|
||||||
string? ExifVersion36864,
|
string? ExifVersion36864,
|
||||||
string? DateTimeOriginal36867,
|
string? DateTimeOriginal36867,
|
||||||
string? DateTimeDigitized36868,
|
string? DateTimeDigitized36868,
|
||||||
string? TimeZone36880,
|
string? TimeZone36880,
|
||||||
string? TimeZoneOriginal36881,
|
string? TimeZoneOriginal36881,
|
||||||
string? TimeZoneDigitized36882,
|
string? TimeZoneDigitized36882,
|
||||||
string? FocalLength37386,
|
string? FocalLength37386,
|
||||||
string? ComponentsConfiguration37121,
|
string? ComponentsConfiguration37121,
|
||||||
string? ShutterSpeed37377,
|
string? ShutterSpeed37377,
|
||||||
string? Aperture37378,
|
string? Aperture37378,
|
||||||
string? BrightnessValue37379,
|
string? BrightnessValue37379,
|
||||||
string? ExposureBias37380,
|
string? ExposureBias37380,
|
||||||
string? MaxAperture37381,
|
string? MaxAperture37381,
|
||||||
string? SubjectDistance37382,
|
string? SubjectDistance37382,
|
||||||
string? MeteringMode37383,
|
string? MeteringMode37383,
|
||||||
string? WhiteBalance37384,
|
string? WhiteBalance37384,
|
||||||
string? CompressedAverageBitsPerPixel37122,
|
string? CompressedAverageBitsPerPixel37122,
|
||||||
string? IsoSpeed34867,
|
string? IsoSpeed34867,
|
||||||
string? FlashpixVersion40960,
|
string? FlashpixVersion40960,
|
||||||
string? ExifImageWidth40962,
|
string? ExifImageWidth40962,
|
||||||
string? Sharpness41994,
|
string? Sharpness41994,
|
||||||
string? DeviceSettingDescription41995,
|
string? DeviceSettingDescription41995,
|
||||||
string? SubjectDistanceRange41996,
|
string? SubjectDistanceRange41996,
|
||||||
string? ImageUniqueId42016,
|
string? ImageUniqueId42016,
|
||||||
string? CameraOwnerName42032,
|
string? CameraOwnerName42032,
|
||||||
string? BodySerialNumber42033,
|
string? BodySerialNumber42033,
|
||||||
string? LensSpecification42034,
|
string? LensSpecification42034,
|
||||||
string? LensMake42035,
|
string? LensMake42035,
|
||||||
string? Saturation41993,
|
string? Saturation41993,
|
||||||
string? LensModel42036,
|
string? LensModel42036,
|
||||||
string? GdalMetadata42112,
|
string? GdalMetadata42112,
|
||||||
string? GdalNoData42113,
|
string? GdalNoData42113,
|
||||||
string? Gamma42240,
|
string? Gamma42240,
|
||||||
string? PrintImageMatchingInfo50341,
|
string? PrintImageMatchingInfo50341,
|
||||||
string? PanasonicTitle50898,
|
string? PanasonicTitle50898,
|
||||||
string? PanasonicTitle250899,
|
string? PanasonicTitle250899,
|
||||||
string? Padding59932,
|
string? Padding59932,
|
||||||
string? Lens65002,
|
string? Lens65002,
|
||||||
string? LensSerialNumber42037,
|
string? LensSerialNumber42037,
|
||||||
string? ColorSpace40961,
|
string? ColorSpace40961,
|
||||||
string? Contrast41992,
|
string? Contrast41992,
|
||||||
string? SceneCaptureType41990,
|
string? SceneCaptureType41990,
|
||||||
string? ExifImageHeight40963,
|
string? ExifImageHeight40963,
|
||||||
string? RelatedSoundFile40964,
|
string? RelatedSoundFile40964,
|
||||||
string? FlashEnergy41483,
|
string? FlashEnergy41483,
|
||||||
string? SpatialFreqResponse41484,
|
string? SpatialFreqResponse41484,
|
||||||
string? FocalPlaneXResolution41486,
|
string? FocalPlaneXResolution41486,
|
||||||
string? FocalPlaneYResolution41487,
|
string? FocalPlaneYResolution41487,
|
||||||
string? FocalPlaneResolutionUnit41488,
|
string? FocalPlaneResolutionUnit41488,
|
||||||
string? SubjectLocation41492,
|
string? SubjectLocation41492,
|
||||||
string? GainControl41991,
|
string? GainControl41991,
|
||||||
string? ExposureIndex41493,
|
string? ExposureIndex41493,
|
||||||
string? FileSource41728,
|
string? FileSource41728,
|
||||||
string? SceneType41729,
|
string? SceneType41729,
|
||||||
string? CfaPattern41730,
|
string? CfaPattern41730,
|
||||||
string? CustomRendered41985,
|
string? CustomRendered41985,
|
||||||
string? ExposureMode41986,
|
string? ExposureMode41986,
|
||||||
string? WhiteBalanceMode41987,
|
string? WhiteBalanceMode41987,
|
||||||
string? DigitalZoomRatio41988,
|
string? DigitalZoomRatio41988,
|
||||||
string? Film35MMEquivFocalLength41989,
|
string? Film35MMEquivFocalLength41989,
|
||||||
string? SensingMethod41495,
|
string? SensingMethod41495,
|
||||||
string? RecommendedExposureIndex34866,
|
string? RecommendedExposureIndex34866,
|
||||||
string? StandardOutputSensitivity34865,
|
string? StandardOutputSensitivity34865,
|
||||||
string? SensitivityType34864,
|
string? SensitivityType34864,
|
||||||
string? YResolution283,
|
string? YResolution283,
|
||||||
string? PlanarConfiguration284,
|
string? PlanarConfiguration284,
|
||||||
string? PageName285,
|
string? PageName285,
|
||||||
string? ResolutionUnit296,
|
string? ResolutionUnit296,
|
||||||
string? PageNumber297,
|
string? PageNumber297,
|
||||||
string? TransferFunction301,
|
string? TransferFunction301,
|
||||||
string? Software305,
|
string? Software305,
|
||||||
string? DateTime306,
|
string? DateTime306,
|
||||||
string? XResolution282,
|
string? XResolution282,
|
||||||
string? Artist315,
|
string? Artist315,
|
||||||
string? Predictor317,
|
string? Predictor317,
|
||||||
string? WhitePoint318,
|
string? WhitePoint318,
|
||||||
string? PrimaryChromaticities319,
|
string? PrimaryChromaticities319,
|
||||||
string? TileWidth322,
|
string? TileWidth322,
|
||||||
string? TileLength323,
|
string? TileLength323,
|
||||||
string? TileOffsets324,
|
string? TileOffsets324,
|
||||||
string? TileByteCounts325,
|
string? TileByteCounts325,
|
||||||
string? SubIfdOffset330,
|
string? SubIfdOffset330,
|
||||||
string? HostComputer316,
|
string? HostComputer316,
|
||||||
string? ExtraSamples338,
|
string? ExtraSamples338,
|
||||||
string? MaxSampleValue281,
|
string? MaxSampleValue281,
|
||||||
string? StripByteCounts279,
|
string? StripByteCounts279,
|
||||||
string? InteropVersion2,
|
string? InteropVersion2,
|
||||||
string? NewSubfileType254,
|
string? NewSubfileType254,
|
||||||
string? SubfileType255,
|
string? SubfileType255,
|
||||||
string? ImageWidth256,
|
string? ImageWidth256,
|
||||||
string? ImageHeight257,
|
string? ImageHeight257,
|
||||||
string? BitsPerSample258,
|
string? BitsPerSample258,
|
||||||
string? Compression259,
|
string? Compression259,
|
||||||
string? PhotometricInterpretation262,
|
string? PhotometricInterpretation262,
|
||||||
string? MinSampleValue280,
|
string? MinSampleValue280,
|
||||||
string? Thresholding263,
|
string? Thresholding263,
|
||||||
string? DocumentName269,
|
string? DocumentName269,
|
||||||
string? ImageDescription270,
|
string? ImageDescription270,
|
||||||
string? Make271,
|
string? Make271,
|
||||||
string? Model272,
|
string? Model272,
|
||||||
string? StripOffsets273,
|
string? StripOffsets273,
|
||||||
string? Orientation274,
|
string? Orientation274,
|
||||||
string? SamplesPerPixel277,
|
string? SamplesPerPixel277,
|
||||||
string? RowsPerStrip278,
|
string? RowsPerStrip278,
|
||||||
string? FillOrder266,
|
string? FillOrder266,
|
||||||
string? SampleFormat339,
|
string? SampleFormat339,
|
||||||
string? TransferRange342,
|
string? TransferRange342,
|
||||||
string? JpegTables347,
|
string? JpegTables347,
|
||||||
string? FNumber33437,
|
string? FNumber33437,
|
||||||
string? PixelScale33550,
|
string? PixelScale33550,
|
||||||
string? IptcNaa33723,
|
string? IptcNaa33723,
|
||||||
string? ModelTiePoint33922,
|
string? ModelTiePoint33922,
|
||||||
string? PhotoshopSettings34377,
|
string? PhotoshopSettings34377,
|
||||||
string? InterColorProfile34675,
|
string? InterColorProfile34675,
|
||||||
string? GeoTiffGeoKeys34735,
|
string? GeoTiffGeoKeys34735,
|
||||||
string? GeoTiffGeoDoubleParams34736,
|
string? GeoTiffGeoDoubleParams34736,
|
||||||
string? ExposureTime33434,
|
string? ExposureTime33434,
|
||||||
string? GeoTiffGeoAsciiParams34737,
|
string? GeoTiffGeoAsciiParams34737,
|
||||||
string? SpectralSensitivity34852,
|
string? SpectralSensitivity34852,
|
||||||
string? IsoEquivalent34855,
|
string? IsoEquivalent34855,
|
||||||
string? OptoElectricConversionFunction34856,
|
string? OptoElectricConversionFunction34856,
|
||||||
string? Interlace34857,
|
string? Interlace34857,
|
||||||
string? TimeZoneOffsetTiffEp34858,
|
string? TimeZoneOffsetTiffEp34858,
|
||||||
string? SelfTimerModeTiffEp34859,
|
string? SelfTimerModeTiffEp34859,
|
||||||
string? TimeZoneOffset34858,
|
string? TimeZoneOffset34858,
|
||||||
string? SelfTimerMode34859,
|
string? SelfTimerMode34859,
|
||||||
string? ExposureProgram34850,
|
string? ExposureProgram34850,
|
||||||
string? Copyright33432,
|
string? Copyright33432,
|
||||||
string? BatteryLevel33423,
|
string? BatteryLevel33423,
|
||||||
string? CfaPattern233422,
|
string? CfaPattern233422,
|
||||||
string? JpegProc512,
|
string? JpegProc512,
|
||||||
string? JpegRestartInterval515,
|
string? JpegRestartInterval515,
|
||||||
string? JpegLosslessPredictors517,
|
string? JpegLosslessPredictors517,
|
||||||
string? JpegPointTransforms518,
|
string? JpegPointTransforms518,
|
||||||
string? JpegQTables519,
|
string? JpegQTables519,
|
||||||
string? JpegDcTables520,
|
string? JpegDcTables520,
|
||||||
string? JpegAcTables521,
|
string? JpegAcTables521,
|
||||||
string? YCbCrCoefficients529,
|
string? YCbCrCoefficients529,
|
||||||
string? YCbCrSubsampling530,
|
string? YCbCrSubsampling530,
|
||||||
string? YCbCrPositioning531,
|
string? YCbCrPositioning531,
|
||||||
string? ReferenceBlackWhite532,
|
string? ReferenceBlackWhite532,
|
||||||
string? StripRowCounts559,
|
string? StripRowCounts559,
|
||||||
string? ApplicationNotes700,
|
string? ApplicationNotes700,
|
||||||
string? RelatedImageFileFormat4096,
|
string? RelatedImageFileFormat4096,
|
||||||
string? RelatedImageWidth4097,
|
string? RelatedImageWidth4097,
|
||||||
string? RelatedImageHeight4098,
|
string? RelatedImageHeight4098,
|
||||||
string? Rating18246,
|
string? Rating18246,
|
||||||
string? RatingPercent18249,
|
string? RatingPercent18249,
|
||||||
string? CfaRepeatPatternDim33421)
|
string? CfaRepeatPatternDim33421)
|
||||||
{
|
{
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -3,22 +3,22 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace View_by_Distance.Metadata.Models;
|
namespace View_by_Distance.Metadata.Models;
|
||||||
|
|
||||||
public record QuickTimeMovieHeader(string? Version1,
|
public record QuickTimeMovieHeader(string? Version1,
|
||||||
string? NextTrackId16,
|
string? NextTrackId16,
|
||||||
string? CurrentTime15,
|
string? CurrentTime15,
|
||||||
string? SelectionDuration14,
|
string? SelectionDuration14,
|
||||||
string? SelectionTime13,
|
string? SelectionTime13,
|
||||||
string? PosterTime12,
|
string? PosterTime12,
|
||||||
string? PreviewDuration11,
|
string? PreviewDuration11,
|
||||||
string? PreviewTime10,
|
string? PreviewTime10,
|
||||||
string? Matrix9,
|
string? Matrix9,
|
||||||
string? PreferredVolume8,
|
string? PreferredVolume8,
|
||||||
string? PreferredRate7,
|
string? PreferredRate7,
|
||||||
string? Duration6,
|
string? Duration6,
|
||||||
string? TimeScale5,
|
string? TimeScale5,
|
||||||
string? Modified4,
|
string? Modified4,
|
||||||
string? Created3,
|
string? Created3,
|
||||||
string? Flags2)
|
string? Flags2)
|
||||||
{
|
{
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -3,19 +3,19 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace View_by_Distance.Metadata.Models;
|
namespace View_by_Distance.Metadata.Models;
|
||||||
|
|
||||||
public record QuickTimeTrackHeader(string? Version1,
|
public record QuickTimeTrackHeader(string? Version1,
|
||||||
string? Flags2,
|
string? Flags2,
|
||||||
string? Created3,
|
string? Created3,
|
||||||
string? Modified4,
|
string? Modified4,
|
||||||
string? TrackId5,
|
string? TrackId5,
|
||||||
string? Duration6,
|
string? Duration6,
|
||||||
string? Layer7,
|
string? Layer7,
|
||||||
string? AlternateGroup8,
|
string? AlternateGroup8,
|
||||||
string? Volume9,
|
string? Volume9,
|
||||||
string? Width10,
|
string? Width10,
|
||||||
string? Height11,
|
string? Height11,
|
||||||
string? Matrix12,
|
string? Matrix12,
|
||||||
string? Rotation13)
|
string? Rotation13)
|
||||||
{
|
{
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -38,7 +38,7 @@ public class MoveById
|
|||||||
string? comparePathRoot = Path.GetDirectoryName(appSettings.ComparePathsFile);
|
string? comparePathRoot = Path.GetDirectoryName(appSettings.ComparePathsFile);
|
||||||
if (comparePathRoot is null || comparePathRoot == propertyConfiguration.RootDirectory)
|
if (comparePathRoot is null || comparePathRoot == propertyConfiguration.RootDirectory)
|
||||||
throw new Exception("Nested isn't allowed!");
|
throw new Exception("Nested isn't allowed!");
|
||||||
logger?.LogInformation(propertyConfiguration.RootDirectory);
|
logger?.LogInformation(propertyConfiguration.RootDirectory);
|
||||||
Property.Models.Configuration.Verify(propertyConfiguration, requireExist: false);
|
Property.Models.Configuration.Verify(propertyConfiguration, requireExist: false);
|
||||||
Verify();
|
Verify();
|
||||||
string json = File.ReadAllText(appSettings.ComparePathsFile);
|
string json = File.ReadAllText(appSettings.ComparePathsFile);
|
||||||
|
@ -16,7 +16,8 @@ public abstract class Configuration
|
|||||||
Binder.Configuration? configuration = configurationSection.Get<Binder.Configuration>();
|
Binder.Configuration? configuration = configurationSection.Get<Binder.Configuration>();
|
||||||
string json = JsonSerializer.Serialize(configuration, new JsonSerializerOptions() { WriteIndented = true });
|
string json = JsonSerializer.Serialize(configuration, new JsonSerializerOptions() { WriteIndented = true });
|
||||||
result = JsonSerializer.Deserialize<Models.Configuration>(json);
|
result = JsonSerializer.Deserialize<Models.Configuration>(json);
|
||||||
if (result is null) throw new Exception(json);
|
if (result is null)
|
||||||
|
throw new Exception(json);
|
||||||
string jsonThis = result.ToString();
|
string jsonThis = result.ToString();
|
||||||
if (jsonThis != json)
|
if (jsonThis != json)
|
||||||
{
|
{
|
||||||
@ -29,10 +30,11 @@ public abstract class Configuration
|
|||||||
check = i;
|
check = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (check is null) throw new Exception();
|
if (check is null)
|
||||||
|
throw new Exception();
|
||||||
string a = json[..check.Value].Split(',')[^1];
|
string a = json[..check.Value].Split(',')[^1];
|
||||||
string b = json[check.Value..].Split(',')[0];
|
string b = json[check.Value..].Split(',')[0];
|
||||||
throw new Exception($"{a}{b}");
|
throw new Exception($"{a}{b}");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class Configuration
|
|||||||
// if (configuration.ModelName is null) throw new NullReferenceException(nameof(configuration.ModelName));
|
// if (configuration.ModelName is null) throw new NullReferenceException(nameof(configuration.ModelName));
|
||||||
// if (configuration.NumberOfJitters is null) throw new NullReferenceException(nameof(configuration.NumberOfJitters));
|
// if (configuration.NumberOfJitters is null) throw new NullReferenceException(nameof(configuration.NumberOfJitters));
|
||||||
// if (configuration.NumberOfTimesToUpsample is null) throw new NullReferenceException(nameof(configuration.NumberOfTimesToUpsample));
|
// if (configuration.NumberOfTimesToUpsample is null) throw new NullReferenceException(nameof(configuration.NumberOfTimesToUpsample));
|
||||||
if (configuration.Offset is null) throw new NullReferenceException(nameof(configuration.Offset));;
|
if (configuration.Offset is null) throw new NullReferenceException(nameof(configuration.Offset)); ;
|
||||||
if (configuration.Pattern is null) throw new NullReferenceException(nameof(configuration.Pattern));
|
if (configuration.Pattern is null) throw new NullReferenceException(nameof(configuration.Pattern));
|
||||||
if (configuration.PersonBirthdayFormat is null) throw new NullReferenceException(nameof(configuration.PersonBirthdayFormat));
|
if (configuration.PersonBirthdayFormat is null) throw new NullReferenceException(nameof(configuration.PersonBirthdayFormat));
|
||||||
if (configuration.PopulatePropertyId is null) throw new NullReferenceException(nameof(configuration.PopulatePropertyId));
|
if (configuration.PopulatePropertyId is null) throw new NullReferenceException(nameof(configuration.PopulatePropertyId));
|
||||||
|
@ -95,17 +95,28 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
|||||||
|
|
||||||
public static void Verify(Configuration propertyConfiguration, bool requireExist)
|
public static void Verify(Configuration propertyConfiguration, bool requireExist)
|
||||||
{
|
{
|
||||||
if (propertyConfiguration is null) throw new NullReferenceException(nameof(propertyConfiguration));
|
if (propertyConfiguration is null)
|
||||||
if (propertyConfiguration.IgnoreExtensions is null || propertyConfiguration.IgnoreExtensions.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.IgnoreExtensions));
|
throw new NullReferenceException(nameof(propertyConfiguration));
|
||||||
if (propertyConfiguration.IgnoreRulesKeyWords is null || propertyConfiguration.IgnoreRulesKeyWords.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.IgnoreRulesKeyWords));
|
if (propertyConfiguration.IgnoreExtensions is null || propertyConfiguration.IgnoreExtensions.Length == 0)
|
||||||
if (propertyConfiguration.PropertyContentCollectionFiles is null) throw new NullReferenceException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
|
throw new NullReferenceException(nameof(propertyConfiguration.IgnoreExtensions));
|
||||||
if (propertyConfiguration.ValidImageFormatExtensions is null || propertyConfiguration.ValidImageFormatExtensions.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.ValidImageFormatExtensions));
|
if (propertyConfiguration.IgnoreRulesKeyWords is null || propertyConfiguration.IgnoreRulesKeyWords.Length == 0)
|
||||||
if (propertyConfiguration is null) throw new NullReferenceException(nameof(propertyConfiguration));
|
throw new NullReferenceException(nameof(propertyConfiguration.IgnoreRulesKeyWords));
|
||||||
if (string.IsNullOrEmpty(propertyConfiguration.DateGroup)) throw new NullReferenceException(nameof(propertyConfiguration.DateGroup));
|
if (propertyConfiguration.PropertyContentCollectionFiles is null)
|
||||||
if (string.IsNullOrEmpty(propertyConfiguration.FileNameDirectorySeparator)) throw new NullReferenceException(nameof(propertyConfiguration.FileNameDirectorySeparator));
|
throw new NullReferenceException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
|
||||||
if (string.IsNullOrEmpty(propertyConfiguration.Pattern)) throw new NullReferenceException(nameof(propertyConfiguration.Pattern));
|
if (propertyConfiguration.ValidImageFormatExtensions is null || propertyConfiguration.ValidImageFormatExtensions.Length == 0)
|
||||||
if (string.IsNullOrEmpty(propertyConfiguration.RootDirectory) || (requireExist && !Directory.Exists(propertyConfiguration.RootDirectory))) throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
|
throw new NullReferenceException(nameof(propertyConfiguration.ValidImageFormatExtensions));
|
||||||
if (propertyConfiguration.RootDirectory != Path.GetFullPath(propertyConfiguration.RootDirectory)) throw new Exception();
|
if (propertyConfiguration is null)
|
||||||
|
throw new NullReferenceException(nameof(propertyConfiguration));
|
||||||
|
if (string.IsNullOrEmpty(propertyConfiguration.DateGroup))
|
||||||
|
throw new NullReferenceException(nameof(propertyConfiguration.DateGroup));
|
||||||
|
if (string.IsNullOrEmpty(propertyConfiguration.FileNameDirectorySeparator))
|
||||||
|
throw new NullReferenceException(nameof(propertyConfiguration.FileNameDirectorySeparator));
|
||||||
|
if (string.IsNullOrEmpty(propertyConfiguration.Pattern))
|
||||||
|
throw new NullReferenceException(nameof(propertyConfiguration.Pattern));
|
||||||
|
if (string.IsNullOrEmpty(propertyConfiguration.RootDirectory) || (requireExist && !Directory.Exists(propertyConfiguration.RootDirectory)))
|
||||||
|
throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
|
||||||
|
if (propertyConfiguration.RootDirectory != Path.GetFullPath(propertyConfiguration.RootDirectory))
|
||||||
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user