Used to re-organized folders

This commit is contained in:
2023-11-12 18:09:22 -07:00
parent c2757ef46b
commit 0310e06f3c
11 changed files with 193 additions and 151 deletions

View File

@ -31,6 +31,7 @@ public class AppSettings
continue;
throw new NotSupportedException(physicalFileProvider.Root);
}
throw new NotSupportedException("Not Found!");
}
}

View File

@ -8,6 +8,8 @@ public class RenameConfiguration
{
public string[]? IgnoreExtensions { get; set; }
public bool? MoveFilesToRoot { get; set; }
public bool? SkipIdFiles { get; set; }
public string[]? ValidImageFormatExtensions { get; set; }
public override string ToString()
@ -30,6 +32,7 @@ public class RenameConfiguration
continue;
throw new NotSupportedException(physicalFileProvider.Root);
}
throw new NotSupportedException("Not Found!");
}
}
@ -44,10 +47,14 @@ public class RenameConfiguration
Models.RenameConfiguration result;
if (configuration is null) throw new NullReferenceException(nameof(configuration));
if (configuration.IgnoreExtensions is null) throw new NullReferenceException(nameof(configuration.IgnoreExtensions));
if (configuration.MoveFilesToRoot is null) throw new NullReferenceException(nameof(configuration.MoveFilesToRoot));
if (configuration.SkipIdFiles is null) throw new NullReferenceException(nameof(configuration.SkipIdFiles));
if (configuration.ValidImageFormatExtensions is null) throw new NullReferenceException(nameof(configuration.ValidImageFormatExtensions));
Verify(configuration);
result = new(metadataConfiguration,
configuration.IgnoreExtensions,
configuration.MoveFilesToRoot.Value,
configuration.SkipIdFiles.Value,
configuration.ValidImageFormatExtensions);
return result;
}

View File

@ -6,7 +6,9 @@ namespace View_by_Distance.Rename.Models;
public record RenameConfiguration(Shared.Models.MetadataConfiguration MetadataConfiguration,
string[] IgnoreExtensions,
string[] ValidImageFormatExtensions)
bool MoveFilesToRoot,
bool SkipIdFiles,
string[] ValidImageFormatExtensions) : Shared.Models.Properties.IRenameConfiguration
{
public override string ToString()