validation-image-file
This commit is contained in:
parent
23256c8152
commit
9a51d995cc
@ -19,7 +19,9 @@ public record RenameSettings(string Company,
|
||||
string RelativePropertyCollectionFile,
|
||||
bool RequireRootDirectoryExists,
|
||||
string[] SidecarExtensions,
|
||||
bool SkipIdFiles) : Shared.Models.Properties.IRenameSettings
|
||||
bool SkipIdFiles,
|
||||
int ValidationImageDeterministicHashCodeId,
|
||||
string ValidationImageFile) : Shared.Models.Properties.IRenameSettings
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
|
@ -127,9 +127,22 @@ public partial class Rename : IRename, IDisposable
|
||||
LogNetToHoursSince(logger);
|
||||
long ticks = DateTime.Now.Ticks;
|
||||
_ProgressBarOptions = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
||||
Verify(logger, appSettings, rename);
|
||||
RenameWork(logger, appSettings, rename, ticks);
|
||||
}
|
||||
|
||||
private static void Verify(ILogger<Program>? logger, AppSettings appSettings, IRename rename)
|
||||
{
|
||||
FileHolder fileHolder = FileHolder.Get(appSettings.RenameSettings.ValidationImageFile);
|
||||
FilePath filePath = FilePath.Get(appSettings.ResultSettings, appSettings.MetadataSettings, fileHolder, index: null);
|
||||
DeterministicHashCode deterministicHashCode = rename.GetDeterministicHashCode(filePath);
|
||||
if (deterministicHashCode.Id is null)
|
||||
throw new NullReferenceException(nameof(deterministicHashCode));
|
||||
if (deterministicHashCode.Id.Value != appSettings.RenameSettings.ValidationImageDeterministicHashCodeId)
|
||||
throw new Exception("Deterministic hash code id is incorrect!");
|
||||
logger?.LogDebug("Validated deterministic hash code id");
|
||||
}
|
||||
|
||||
private static void LogNetToHoursSince(ILogger<Program>? logger)
|
||||
{
|
||||
double secondsInAHour = 3600f;
|
||||
|
Loading…
x
Reference in New Issue
Block a user