This commit is contained in:
2022-08-22 09:10:19 -07:00
parent f72fcee1db
commit bc2174b17a
150 changed files with 4323 additions and 6259 deletions

View File

@ -26,23 +26,22 @@ public class NotCopyCopy
_AppSettings = appSettings;
_IsEnvironment = isEnvironment;
_Log = Serilog.Log.ForContext<NotCopyCopy>();
Property.Models.Configuration propertyConfiguration = Property.Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory);
Property.Models.Configuration propertyConfiguration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot);
Property.Models.Configuration.Verify(propertyConfiguration);
Models.Configuration configuration = Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory, propertyConfiguration);
Verify(configuration);
bool reverse = false;
Model? model = null;
PredictorModel? predictorModel = null;
string outputExtension = ".jpg";
_Configuration = configuration;
if (propertyConfiguration.PopulatePropertyId is null)
throw new NullReferenceException(nameof(propertyConfiguration.PopulatePropertyId));
PredictorModel? predictorModel = null;
if (!_IsEnvironment.Development)
throw new Exception("This program only allows development environments!");
PropertyLogic propertyLogic = GetPropertyLogic(reverse, model, predictorModel);
A_Property propertyLogic = GetPropertyLogic(reverse, model, outputExtension, predictorModel);
propertyConfiguration.ChangeRootDirectory(configuration.CompareSource);
List<Container> compareContainers = Property.Models.Stateless.A_Property.Get(propertyConfiguration, propertyLogic);
List<Shared.Models.Container> compareContainers = A_Property.Get(propertyConfiguration, propertyLogic);
propertyConfiguration.ChangeRootDirectory(configuration.SelectedSource);
List<Container> selectedContainers = Property.Models.Stateless.A_Property.Get(propertyConfiguration, propertyLogic);
List<Shared.Models.Container> selectedContainers = A_Property.Get(propertyConfiguration, propertyLogic);
if (compareContainers.Count == selectedContainers.Count)
throw new Exception();
string directoryName;
@ -103,12 +102,12 @@ public class NotCopyCopy
throw new NullReferenceException(nameof(configuration.SelectedSource));
}
private PropertyLogic GetPropertyLogic(bool reverse, Model? model, PredictorModel? predictorModel)
private A_Property GetPropertyLogic(bool reverse, Model? model, string outputExtension, PredictorModel? predictorModel)
{
PropertyLogic result;
A_Property result;
if (_Configuration?.PropertyConfiguration is null)
throw new NullReferenceException(nameof(_Configuration.PropertyConfiguration));
result = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, reverse, model, predictorModel);
result = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, outputExtension, reverse, model, predictorModel);
return result;
}
@ -119,12 +118,12 @@ public class NotCopyCopy
throw new NullReferenceException(nameof(_Configuration.PropertyConfiguration));
string key;
string fileName;
A_Property? property;
Shared.Models.Property? property;
string destinationDirectory;
List<string> directoryNames;
List<string> destinationCollection;
string filteredSourceDirectoryFile;
Dictionary<string, A_Property> keyValuePairs = new();
Dictionary<string, Shared.Models.Property> keyValuePairs = new();
foreach (Property.Models.DirectoryInfo group in compareSourceGroupCollection)
{
for (int i = 0; i < group.SourceDirectoryFileHolderCollection.Length; i++)
@ -150,7 +149,7 @@ public class NotCopyCopy
if (keyValuePairs.ContainsKey(key) && keyValuePairs[key].LastWriteTime == property.LastWriteTime)
continue;
destinationDirectory = string.Concat(_Configuration.EmptyDestination, group.SourceDirectory[_Configuration.SelectedSource.Length..]);
directoryNames = Property.Models.Stateless.IPath.GetDirectoryNames(destinationDirectory);
directoryNames = Shared.Models.Stateless.Methods.IPath.GetDirectoryNames(destinationDirectory);
destinationCollection.AddRange(directoryNames);
destinationCollection.Add(fileName);
results.Add(new(filteredSourceDirectoryFile, destinationCollection.ToArray()));

View File

@ -10,7 +10,7 @@
<PropertyGroup>
<PackageId>Phares.View.by.Distance.Not.Copy.Copy</PackageId>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>5.0.402.104</Version>
<Version>6.0.100.1</Version>
<Authors>Mike Phares</Authors>
<Company>Phares</Company>
<IncludeSymbols>true</IncludeSymbols>

View File

@ -39,60 +39,60 @@ public class Program
if (args is null)
throw new Exception("args is null!");
#nullable disable
if (Property.Models.Stateless.A_Property.IsWrongYear("-".Split(' '), "2021").Item1.HasValue)
if (IProperty.IsWrongYear("-".Split(' '), "2021").Item1.HasValue)
throw new Exception("-");
if (Property.Models.Stateless.A_Property.IsWrongYear("Christmass".Split(' '), "2021").Item1.HasValue)
if (IProperty.IsWrongYear("Christmass".Split(' '), "2021").Item1.HasValue)
throw new Exception("Christmass");
if (Property.Models.Stateless.A_Property.IsWrongYear("Christmass 2021".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Christmass 2021".Split(' '), "2021").Item1.Value)
throw new Exception("Christmass");
if (Property.Models.Stateless.A_Property.IsWrongYear("Christmass ~2021".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Christmass ~2021".Split(' '), "2021").Item1.Value)
throw new Exception("Christmass");
if (Property.Models.Stateless.A_Property.IsWrongYear("Christmass ~2021.4".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Christmass ~2021.4".Split(' '), "2021").Item1.Value)
throw new Exception("Christmass");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Christmass 2021".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Christmass 2021".Split(' '), "2025").Item1.Value)
throw new Exception("Christmass");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Christmass ~2021".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Christmass ~2021".Split(' '), "2025").Item1.Value)
throw new Exception("Christmass");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Christmass ~2021.4".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Christmass ~2021.4".Split(' '), "2025").Item1.Value)
throw new Exception("Christmass");
if (Property.Models.Stateless.A_Property.IsWrongYear("England 2017".Split(' '), "2017").Item1.Value)
if (IProperty.IsWrongYear("England 2017".Split(' '), "2017").Item1.Value)
throw new Exception("England");
if (Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael".Split(' '), "2021").Item1.HasValue)
if (IProperty.IsWrongYear("Logan Michael".Split(' '), "2021").Item1.HasValue)
throw new Exception("Logan Michael");
if (Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael 2021".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Logan Michael 2021".Split(' '), "2021").Item1.Value)
throw new Exception("Logan Michael");
if (Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael ~2021".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Logan Michael ~2021".Split(' '), "2021").Item1.Value)
throw new Exception("Logan Michael");
if (Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2021").Item1.Value)
if (IProperty.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2021").Item1.Value)
throw new Exception("Logan Michael");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael 2021".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Logan Michael 2021".Split(' '), "2025").Item1.Value)
throw new Exception("Logan Michael");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael ~2021".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Logan Michael ~2021".Split(' '), "2025").Item1.Value)
throw new Exception("Logan Michael");
if (!Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2025").Item1.Value)
if (!IProperty.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2025").Item1.Value)
throw new Exception("Logan Michael");
if (Property.Models.Stateless.A_Property.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2021").Item2[0] != "~2021.4")
if (IProperty.IsWrongYear("Logan Michael ~2021.4".Split(' '), "2021").Item2[0] != "~2021.4")
throw new Exception("Logan Michael");
if (Property.Models.Stateless.A_Property.IsWrongYear("Chelsea's 2nd Birthday =2014".Split(' '), "2014").Item1.Value)
if (IProperty.IsWrongYear("Chelsea's 2nd Birthday =2014".Split(' '), "2014").Item1.Value)
throw new Exception("Chelsea");
#nullable restore
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"C:\Tmp")[0] != @"C:\")
if (IPath.GetDirectoryNames(@"C:\Tmp")[0] != @"C:\")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"C:\Tmp")[1] != "Tmp")
if (IPath.GetDirectoryNames(@"C:\Tmp")[1] != "Tmp")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"C:\Tmp\mike.txt")[1] != "Tmp")
if (IPath.GetDirectoryNames(@"C:\Tmp\mike.txt")[1] != "Tmp")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"C:\Tmp\a.txt")[1] != "Tmp")
if (IPath.GetDirectoryNames(@"C:\Tmp\a.txt")[1] != "Tmp")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"C:\Tmp\Mike\a.txt")[2] != "Mike")
if (IPath.GetDirectoryNames(@"C:\Tmp\Mike\a.txt")[2] != "Mike")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[0] != @"I:\")
if (IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[0] != @"I:\")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[1] != @"Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II")
if (IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[1] != @"Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[2] != @"=2010.2 Summer")
if (IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer\Dsc_8558.jpg")[2] != @"=2010.2 Summer")
throw new Exception();
if (Property.Models.Stateless.IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer")[2] != @"=2010.2 Summer")
if (IPath.GetDirectoryNames(@"I:\Images 2019-06-08 - 34a9240ac28b52da97428d7725153a80a757ee6b - II\=2010.2 Summer")[2] != @"=2010.2 Summer")
throw new Exception();
Shared.Models.Console console = new();
NotCopyCopy _ = new(args, isEnvironment, configurationRoot, appSettings, workingDirectory, silentIndex > -1, console);

View File

@ -50,10 +50,10 @@
"WorkingDirectoryName": "PharesApps",
"Windows": {
"Configuration": {
"DateGroup": "2022-08-14",
"DateGroup": "2022-08-22",
"FileNameDirectorySeparator": ".Z.",
"ForcePropertyLastWriteTimeToCreationTime": false,
"MaxImagesInDirectoryForTopLevelFirstPass": 50,
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
"PopulatePropertyId": false,
"PropertiesChangedForProperty": false,