Mass push
This commit is contained in:
1
Duplicate-Search/.vscode/format-report.json
vendored
Normal file
1
Duplicate-Search/.vscode/format-report.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[]
|
32
Duplicate-Search/.vscode/launch.json
vendored
Normal file
32
Duplicate-Search/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/net6.0/win-x64/Duplicate-Search.dll",
|
||||
"args": [
|
||||
"s"
|
||||
],
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "externalTerminal",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processName": "Duplicate-Search"
|
||||
}
|
||||
]
|
||||
}
|
14
Duplicate-Search/.vscode/settings.json
vendored
Normal file
14
Duplicate-Search/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Barrick",
|
||||
"bcdfghjklmnpqrstvwxyz",
|
||||
"Beichler",
|
||||
"Bohdi",
|
||||
"Dlib",
|
||||
"exif",
|
||||
"nosj",
|
||||
"Phares",
|
||||
"Serilog",
|
||||
"Vericruz"
|
||||
]
|
||||
}
|
42
Duplicate-Search/.vscode/tasks.json
vendored
Normal file
42
Duplicate-Search/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/Duplicate-Search.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Duplicate-Search.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/Duplicate-Search.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
62
Duplicate-Search/Duplicate-Search.csproj
Normal file
62
Duplicate-Search/Duplicate-Search.csproj
Normal file
@ -0,0 +1,62 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PackageId>Phares.View.by.Distance.Duplicate-Search</PackageId>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<Version>6.0.100.1</Version>
|
||||
<Authors>Mike Phares</Authors>
|
||||
<Company>Phares</Company>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
||||
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsWindows)'=='true'">
|
||||
<DefineConstants>Windows</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsOSX)'=='true'">
|
||||
<DefineConstants>OSX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsLinux)'=='true'">
|
||||
<DefineConstants>Linux</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
|
||||
<PackageReference Include="WindowsShortcutFactory" Version="1.1.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Property\Property.csproj" />
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
255
Duplicate-Search/DuplicateSearch.cs
Normal file
255
Duplicate-Search/DuplicateSearch.cs
Normal file
@ -0,0 +1,255 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Phares.Shared;
|
||||
using Serilog;
|
||||
using ShellProgressBar;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using View_by_Distance.Duplicate.Search.Models;
|
||||
using View_by_Distance.Property.Models;
|
||||
using View_by_Distance.Shared.Models;
|
||||
using View_by_Distance.Shared.Models.Methods;
|
||||
|
||||
namespace View_by_Distance.Duplicate.Search;
|
||||
|
||||
public class DuplicateSearch
|
||||
{
|
||||
|
||||
public DuplicateSearch(List<string> args, IsEnvironment isEnvironment, IConfigurationRoot configurationRoot, AppSettings appSettings, string workingDirectory, bool isSilent, IConsole console)
|
||||
{
|
||||
if (isSilent)
|
||||
{ }
|
||||
if (console is null)
|
||||
{ }
|
||||
string searchPattern = "*";
|
||||
long ticks = DateTime.Now.Ticks;
|
||||
ILogger? log = Log.ForContext<DuplicateSearch>();
|
||||
Configuration configuration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot);
|
||||
configuration.Update();
|
||||
log.Information(configuration.RootDirectory);
|
||||
if (appSettings.IndexOnly)
|
||||
WriteIndexData(ticks, configuration, searchPattern);
|
||||
else
|
||||
{
|
||||
Configuration.Verify(configuration, requireExist: false);
|
||||
string argZero = args.Count > 0 ? Path.GetFullPath(args[0]) : Path.GetFullPath(configuration.RootDirectory);
|
||||
bool argZeroIsConfigurationRootDirectory = configuration.RootDirectory == argZero;
|
||||
Container[] containers = GetContainers(appSettings, ticks, argZero, configuration, argZeroIsConfigurationRootDirectory);
|
||||
string destinationRoot = Property.Models.Stateless.IResult.GetResultsGroupDirectory(configuration, "Z) Moved");
|
||||
List<int> preloadIds = GetPreloadIds(destinationRoot);
|
||||
Dictionary<int, List<MappingFromItem?>> idToCollection = GetIdToCollection(appSettings, argZero, configuration, argZeroIsConfigurationRootDirectory, containers, destinationRoot, preloadIds);
|
||||
int duplicates = (from l in idToCollection where l.Value.Count > 1 select 1).Sum();
|
||||
if (duplicates == 0)
|
||||
log.Information($"Found {duplicates} duplicate file(s)");
|
||||
else
|
||||
QuestionMove(ticks, log, destinationRoot, idToCollection, duplicates);
|
||||
}
|
||||
}
|
||||
|
||||
private static void WriteIndexData(long ticks, Configuration configuration, string searchPattern)
|
||||
{
|
||||
string? alongSideDirectory;
|
||||
string directoryName = Path.GetFileName(configuration.RootDirectory);
|
||||
if (Path.GetPathRoot(configuration.RootDirectory) == configuration.RootDirectory)
|
||||
alongSideDirectory = configuration.RootDirectory;
|
||||
else
|
||||
alongSideDirectory = Path.GetDirectoryName(configuration.RootDirectory);
|
||||
if (alongSideDirectory is null)
|
||||
throw new NullReferenceException(nameof(alongSideDirectory));
|
||||
IEnumerable<(string, string[])> files = Shared.Models.Stateless.Methods.IFileHolder.GetFiles(configuration.RootDirectory, searchPattern);
|
||||
List<FileHolder> fileHolders = Shared.Models.Stateless.Methods.IFileHolder.GetFileHolders(files.ToArray());
|
||||
File.WriteAllLines(Path.Combine(alongSideDirectory, $"{directoryName}-{ticks}.tsv"), fileHolders.Select(l => l.FullName));
|
||||
string json = JsonSerializer.Serialize(fileHolders);
|
||||
File.WriteAllText(Path.Combine(alongSideDirectory, $"{directoryName}-{ticks}.json"), json);
|
||||
}
|
||||
|
||||
private static void Move(ILogger log, long ticks, string destinationRoot, List<(FileHolder ImageFileHolder, string Destination)> collection)
|
||||
{
|
||||
StringBuilder stringBuilder = new();
|
||||
foreach ((FileHolder fileHolder, string destination) in collection)
|
||||
{
|
||||
_ = stringBuilder.AppendLine(fileHolder.FullName);
|
||||
_ = stringBuilder.AppendLine(destination);
|
||||
}
|
||||
_ = Shared.Models.Stateless.Methods.IPath.WriteAllText(Path.Combine(destinationRoot, $"{ticks}file(s).lsv"), stringBuilder.ToString(), updateDateWhenMatches: false, compareBeforeWrite: true, updateToWhenMatches: null);
|
||||
log.Information($"Ready to move {collection.Count} file(s)?");
|
||||
for (int y = 0; y < int.MaxValue; y++)
|
||||
{
|
||||
log.Information("Press \"Y\" key to move file(s) or close console to not move files");
|
||||
if (System.Console.ReadKey().Key == ConsoleKey.Y)
|
||||
break;
|
||||
}
|
||||
log.Information(". . .");
|
||||
foreach ((FileHolder fileHolder, string destination) in collection)
|
||||
{
|
||||
try
|
||||
{ File.Move(fileHolder.FullName, destination); }
|
||||
catch (Exception exception)
|
||||
{ log.Error(exception, $"Failed to move <{fileHolder.FullName}>"); }
|
||||
}
|
||||
log.Information($"{collection.Count} file(s) moved");
|
||||
for (int y = 0; y < int.MaxValue; y++)
|
||||
{
|
||||
log.Information("Press \"Y\" key to move file(s) back or close console to leave them moved");
|
||||
if (System.Console.ReadKey().Key != ConsoleKey.Y)
|
||||
continue;
|
||||
log.Information(". . .");
|
||||
foreach ((FileHolder fileHolder, string destination) in collection)
|
||||
{
|
||||
if (!File.Exists(destination))
|
||||
continue;
|
||||
if (File.Exists(fileHolder.FullName))
|
||||
continue;
|
||||
try
|
||||
{ File.Move(destination, fileHolder.FullName); }
|
||||
catch (Exception exception)
|
||||
{ log.Error(exception, $"Failed to move <{destination}>"); }
|
||||
}
|
||||
}
|
||||
log.Information(". . .");
|
||||
}
|
||||
|
||||
private static void QuestionMove(long ticks, ILogger log, string destinationRoot, Dictionary<int, List<MappingFromItem?>> idToCollection, int duplicates)
|
||||
{
|
||||
int[] ids = (from l in idToCollection orderby l.Key where l.Value.Any(m => m is not null) select l.Key).ToArray();
|
||||
_ = Shared.Models.Stateless.Methods.IPath.WriteAllText(Path.Combine(destinationRoot, $"{ticks}-id(s).lsv"), string.Join(Environment.NewLine, ids), updateDateWhenMatches: false, compareBeforeWrite: true, updateToWhenMatches: null);
|
||||
string json = JsonSerializer.Serialize(idToCollection, new JsonSerializerOptions { WriteIndented = true });
|
||||
_ = Shared.Models.Stateless.Methods.IPath.WriteAllText(Path.Combine(destinationRoot, $"{ticks}.json"), json, updateDateWhenMatches: false, compareBeforeWrite: true, updateToWhenMatches: null);
|
||||
log.Information($"Found {duplicates} duplicate file(s)");
|
||||
for (int y = 0; y < int.MaxValue; y++)
|
||||
{
|
||||
log.Information("Press \"Y\" key to continue or close console to leave them moved");
|
||||
if (System.Console.ReadKey().Key != ConsoleKey.Y)
|
||||
continue;
|
||||
log.Information(". . .");
|
||||
List<(FileHolder ImageFileHolder, string Destination)> collection = GetCollectionAndCreateDirectories(idToCollection);
|
||||
Move(log, ticks, destinationRoot, collection);
|
||||
}
|
||||
}
|
||||
|
||||
private static Container[] GetContainers(AppSettings appSettings, long ticks, string argZero, Configuration configuration, bool argZeroIsConfigurationRootDirectory)
|
||||
{
|
||||
int j;
|
||||
int f;
|
||||
int t;
|
||||
Container[] containers;
|
||||
int totalSeconds = (int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds);
|
||||
string message = $") Building Container(s) - {totalSeconds} total second(s)";
|
||||
A_Property propertyLogic = new(appSettings.MaxDegreeOfParallelism, configuration, appSettings.OutputExtension, appSettings.Reverse);
|
||||
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
||||
using (ProgressBar progressBar = new(1, message, options))
|
||||
{
|
||||
progressBar.Tick();
|
||||
(j, f, t, containers) = Property.Models.Stateless.Container.GetContainers(configuration, propertyLogic);
|
||||
}
|
||||
if (appSettings.SortContainers)
|
||||
containers = Shared.Models.Stateless.Methods.IContainer.SortContainers(configuration, appSettings.IgnoreRelativePaths, argZeroIsConfigurationRootDirectory, argZero, containers);
|
||||
return containers;
|
||||
}
|
||||
|
||||
private static Dictionary<int, List<MappingFromItem?>> GetIdToCollection(AppSettings appSettings, string argZero, Configuration configuration, bool argZeroIsConfigurationRootDirectory, Container[] containers, string destinationRoot, List<int> preloadIds)
|
||||
{
|
||||
Dictionary<int, List<MappingFromItem?>> results = new();
|
||||
string directory;
|
||||
const int zero = 0;
|
||||
Item[] filteredItems;
|
||||
bool isIgnoreRelativePath;
|
||||
FileHolder resizedFileHolder;
|
||||
DateTime[] containerDateTimes;
|
||||
MappingFromItem? mappingFromItem;
|
||||
List<MappingFromItem?>? collection;
|
||||
const string duplicates = "-Duplicate(s)";
|
||||
if (containers.Any())
|
||||
{
|
||||
foreach (int id in preloadIds)
|
||||
results.Add(id, new() { null });
|
||||
}
|
||||
foreach (Container container in containers)
|
||||
{
|
||||
if (!container.Items.Any())
|
||||
continue;
|
||||
if (!argZeroIsConfigurationRootDirectory && !container.SourceDirectory.StartsWith(argZero))
|
||||
continue;
|
||||
filteredItems = Shared.Models.Stateless.Methods.IContainer.GetFilterItems(configuration, container);
|
||||
if (!filteredItems.Any())
|
||||
continue;
|
||||
isIgnoreRelativePath = appSettings.IgnoreRelativePaths.Any(l => container.SourceDirectory.Contains(l)) && Shared.Models.Stateless.Methods.IContainer.IsIgnoreRelativePath(configuration, appSettings.IgnoreRelativePaths, container.SourceDirectory);
|
||||
containerDateTimes = Shared.Models.Stateless.Methods.IContainer.GetContainerDateTimes(filteredItems);
|
||||
foreach (Item item in filteredItems)
|
||||
{
|
||||
if (item.Property?.Id is null)
|
||||
{
|
||||
if (int.TryParse(item.ImageFileHolder.NameWithoutExtension, out int id))
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
if (!results.TryGetValue(item.Property.Id.Value, out collection))
|
||||
results.Add(item.Property.Id.Value, new());
|
||||
if (collection is null && !results.TryGetValue(item.Property.Id.Value, out collection))
|
||||
continue;
|
||||
if (collection.Count == 0)
|
||||
directory = $"0{duplicates}";
|
||||
else
|
||||
directory = $"{collection.Count + 1}{duplicates}";
|
||||
if (collection.Count == 1)
|
||||
{
|
||||
mappingFromItem = collection[zero];
|
||||
if (mappingFromItem is not null)
|
||||
{
|
||||
resizedFileHolder = new(mappingFromItem.ResizedFileHolder.FullName.Replace($"0{duplicates}", $"1{duplicates}"));
|
||||
collection[0] = new(mappingFromItem.ContainerDateTimes, mappingFromItem.Id, mappingFromItem.ImageFileHolder, mappingFromItem.IsWrongYear, mappingFromItem.MinimumDateTime, mappingFromItem.RelativePath, resizedFileHolder);
|
||||
}
|
||||
}
|
||||
resizedFileHolder = new(string.Concat(Path.Combine(destinationRoot, directory), item.RelativePath));
|
||||
mappingFromItem = Shared.Models.Stateless.Methods.IMappingFromItem.GetMappingFromItem(containerDateTimes, item, resizedFileHolder);
|
||||
collection.Add(mappingFromItem);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<(FileHolder ImageFileHolder, string Destination)> GetCollectionAndCreateDirectories(Dictionary<int, List<MappingFromItem?>> idToCollection)
|
||||
{
|
||||
List<(FileHolder ImageFileHolder, string Destination)> results = new();
|
||||
List<string> collection = new();
|
||||
foreach (KeyValuePair<int, List<MappingFromItem?>> keyValuePair in idToCollection)
|
||||
{
|
||||
foreach (MappingFromItem? mappingFromItem in keyValuePair.Value)
|
||||
{
|
||||
if (mappingFromItem?.ResizedFileHolder.DirectoryName is null)
|
||||
continue;
|
||||
if (!mappingFromItem.ImageFileHolder.Exists || mappingFromItem.ResizedFileHolder.Exists)
|
||||
continue;
|
||||
collection.Add(mappingFromItem.ResizedFileHolder.DirectoryName);
|
||||
results.Add(new(mappingFromItem.ImageFileHolder, mappingFromItem.ResizedFileHolder.FullName));
|
||||
}
|
||||
}
|
||||
foreach (string directory in collection.Distinct())
|
||||
{
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<int> GetPreloadIds(string destinationRoot)
|
||||
{
|
||||
List<int> results = new();
|
||||
string[] lines;
|
||||
string preloadDirectory = Path.Combine(destinationRoot, "Preload");
|
||||
if (!Directory.Exists(preloadDirectory))
|
||||
_ = Directory.CreateDirectory(preloadDirectory);
|
||||
string[] files = Directory.GetFiles(preloadDirectory, "*.lsv", SearchOption.TopDirectoryOnly);
|
||||
foreach (string file in files)
|
||||
{
|
||||
lines = File.ReadAllLines(file);
|
||||
foreach (string line in lines)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out int id) || id == 0)
|
||||
continue;
|
||||
results.Add(id);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
37
Duplicate-Search/Models/AppSettings.cs
Normal file
37
Duplicate-Search/Models/AppSettings.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Duplicate.Search.Models;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
public string Company { init; get; }
|
||||
public bool IndexOnly { init; get; }
|
||||
public string[] IgnoreRelativePaths { init; get; }
|
||||
public int MaxDegreeOfParallelism { init; get; }
|
||||
public string OutputExtension { init; get; }
|
||||
public bool SortContainers { init; get; }
|
||||
public bool Reverse { init; get; }
|
||||
public string WorkingDirectoryName { init; get; }
|
||||
|
||||
[JsonConstructor]
|
||||
public AppSettings(string company, bool indexOnly, string[] ignoreRelativePaths, int maxDegreeOfParallelism, string outputExtension, bool sortContainers, bool reverse, string workingDirectoryName)
|
||||
{
|
||||
Company = company;
|
||||
IndexOnly = indexOnly;
|
||||
IgnoreRelativePaths = ignoreRelativePaths;
|
||||
MaxDegreeOfParallelism = maxDegreeOfParallelism;
|
||||
OutputExtension = outputExtension;
|
||||
SortContainers = sortContainers;
|
||||
Reverse = reverse;
|
||||
WorkingDirectoryName = workingDirectoryName;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
62
Duplicate-Search/Models/Binder/AppSettings.cs
Normal file
62
Duplicate-Search/Models/Binder/AppSettings.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.Duplicate.Search.Models.Binder;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
#nullable disable
|
||||
|
||||
public string Company { get; set; }
|
||||
public bool? IndexOnly { get; set; }
|
||||
public string[] IgnoreRelativePaths { get; set; }
|
||||
public int? MaxDegreeOfParallelism { get; set; }
|
||||
public string OutputExtension { get; set; }
|
||||
public bool? SortContainers { get; set; }
|
||||
public bool? Reverse { get; set; }
|
||||
public string WorkingDirectoryName { get; set; }
|
||||
|
||||
#nullable restore
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Models.AppSettings Get(AppSettings? appSettings)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
if (appSettings?.IndexOnly is null)
|
||||
throw new NullReferenceException(nameof(appSettings.IndexOnly));
|
||||
if (appSettings?.IgnoreRelativePaths is null)
|
||||
throw new NullReferenceException(nameof(appSettings.IgnoreRelativePaths));
|
||||
if (appSettings?.MaxDegreeOfParallelism is null)
|
||||
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
|
||||
if (appSettings?.SortContainers is null)
|
||||
throw new NullReferenceException(nameof(appSettings.SortContainers));
|
||||
if (appSettings?.Reverse is null)
|
||||
throw new NullReferenceException(nameof(appSettings.Reverse));
|
||||
result = new(
|
||||
appSettings.Company,
|
||||
appSettings.IndexOnly.Value,
|
||||
appSettings.IgnoreRelativePaths,
|
||||
appSettings.MaxDegreeOfParallelism.Value,
|
||||
appSettings.OutputExtension,
|
||||
appSettings.SortContainers.Value,
|
||||
appSettings.Reverse.Value,
|
||||
appSettings.WorkingDirectoryName
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
AppSettings? appSettings = configurationRoot.Get<AppSettings>();
|
||||
result = Get(appSettings);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
10
Duplicate-Search/Models/Stateless/SerilogExtensionMethods.cs
Normal file
10
Duplicate-Search/Models/Stateless/SerilogExtensionMethods.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace View_by_Distance.Duplicate.Search.Models.Stateless;
|
||||
|
||||
public static class SerilogExtensionMethods
|
||||
{
|
||||
|
||||
internal static void Warn(this Serilog.ILogger log, string messageTemplate) => log.Warning(messageTemplate);
|
||||
|
||||
internal static void Info(this Serilog.ILogger log, string messageTemplate) => log.Information(messageTemplate);
|
||||
|
||||
}
|
70
Duplicate-Search/Program.cs
Normal file
70
Duplicate-Search/Program.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Phares.Shared;
|
||||
using Serilog;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using View_by_Distance.Duplicate.Search.Models;
|
||||
using View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
namespace View_by_Distance.Duplicate.Search;
|
||||
|
||||
public class Program
|
||||
{
|
||||
|
||||
public static void Secondary(List<string> args)
|
||||
{
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
bool debuggerWasAttachedAtLineZero = Debugger.IsAttached || assembly.Location.Contains(@"\bin\Debug");
|
||||
IsEnvironment isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true);
|
||||
IConfigurationRoot configurationRoot = configurationBuilder.Build();
|
||||
AppSettings appSettings = Models.Binder.AppSettings.Get(configurationRoot);
|
||||
if (appSettings.MaxDegreeOfParallelism > Environment.ProcessorCount)
|
||||
throw new Exception("MaxDegreeOfParallelism must be =< Environment.ProcessorCount!");
|
||||
if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
|
||||
throw new Exception("Working directory name must have a value!");
|
||||
string workingDirectory = IWorkingDirectory.GetWorkingDirectory(assembly.GetName().Name, appSettings.WorkingDirectoryName);
|
||||
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, configurationRoot);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
ILogger log = Log.ForContext<Program>();
|
||||
int silentIndex = args.IndexOf("s");
|
||||
if (silentIndex > -1)
|
||||
args.RemoveAt(silentIndex);
|
||||
try
|
||||
{
|
||||
if (args is null)
|
||||
throw new Exception("args is null!");
|
||||
Shared.Models.Console console = new();
|
||||
_ = new DuplicateSearch(args, isEnvironment, configurationRoot, appSettings, workingDirectory, silentIndex > -1, console);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Fatal(string.Concat(ex.Message, Environment.NewLine, ex.StackTrace));
|
||||
}
|
||||
finally
|
||||
{
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
if (silentIndex > -1)
|
||||
log.Debug("Done. Bye");
|
||||
else
|
||||
{
|
||||
log.Debug("Done. Press 'Enter' to end");
|
||||
_ = Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (args is not null)
|
||||
Secondary(args.ToList());
|
||||
else
|
||||
Secondary(new List<string>());
|
||||
}
|
||||
|
||||
}
|
356
Duplicate-Search/appsettings.Development.json
Normal file
356
Duplicate-Search/appsettings.Development.json
Normal file
@ -0,0 +1,356 @@
|
||||
{
|
||||
"IndexOnly": false,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Log4netProvider": "Debug"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 6,
|
||||
"Serilog": {
|
||||
"MinimumLevel": "Debug"
|
||||
},
|
||||
"SortContainers": false,
|
||||
"IgnoreRelativePaths": [
|
||||
"3757 W Whitman 2017",
|
||||
"501 Playful Meadows 2006",
|
||||
"501 Playful Meadows 2007",
|
||||
"501 Playful Meadows 2008",
|
||||
"501 Playful Meadows 2009",
|
||||
"501 Playful Meadows 2010",
|
||||
"501 Playful Meadows 2013",
|
||||
"501 Playful Meadows 2015",
|
||||
"6309 Evesham 2003",
|
||||
"6309 Evesham 2004",
|
||||
"Crystal's Wedding 2003",
|
||||
"Danny's Wedding 2009",
|
||||
"Door images 2019",
|
||||
"Family Pictures 2006",
|
||||
"Family Pictures 2007",
|
||||
"Family Pictures 2011",
|
||||
"Family Pictures 2013",
|
||||
"GrandPrix 2004",
|
||||
"Kids School Pictures 2004",
|
||||
"Kristy 2002",
|
||||
"Kristy Parents Wedding 2005",
|
||||
"Logan Ultrasound 2007",
|
||||
"Mandy's Dogs 2008",
|
||||
"Motorcycles 2010",
|
||||
"Motorcycles 2013",
|
||||
"Motorcycles 2014",
|
||||
"Phares Slides",
|
||||
"Portrait Innovations April 2008",
|
||||
"Portrait Innovations December 2007",
|
||||
"Portrait Innovations June 2008",
|
||||
"Portrait Innovations March 2012",
|
||||
"The guys house 2000",
|
||||
"Tracy Pictures 2005",
|
||||
"Tracy Pictures 2006",
|
||||
"Tracy Pictures 2007",
|
||||
"Tracy Pictures 2008",
|
||||
"Tracy Pictures 2009",
|
||||
"Tracy Pictures 2010",
|
||||
"Tracy Pictures 2011",
|
||||
"Tracy Pictures 2012",
|
||||
"Tracy Pictures 2013 Jan-July",
|
||||
"Tracy Pictures 2013 July- Dec",
|
||||
"Tracy Pictures 2014",
|
||||
"Tracy Pictures 2015",
|
||||
"Tracy Took The Kids 2006",
|
||||
"Tracy's Bday 2012",
|
||||
"Tracy's Wedding 2002",
|
||||
"Trip to Colorado 10 2002",
|
||||
"Trip to Colorado June 2002",
|
||||
"Tub 2002",
|
||||
"Vericruz 2011",
|
||||
"zzz =2005.1 Spring Tracy Pictures",
|
||||
"zzz =2005.2 Summer Tracy Pictures",
|
||||
"zzz =2005.3 Fall Tracy Pictures",
|
||||
"zzz =2005.4 Winter Tracy Pictures",
|
||||
"zzz =2006.1 Spring Tracy Pictures",
|
||||
"zzz =2007.0 Winter Tracy Pictures",
|
||||
"zzz =2007.2 Summer Tracy Pictures",
|
||||
"zzz =2008.2 Summer Tracy Pictures",
|
||||
"zzz =2009.0 Winter Tracy Pictures",
|
||||
"zzz =2009.2 Summer Tracy Pictures",
|
||||
"zzz =2009.3 Fall Tracy Pictures",
|
||||
"zzz =2009.4 Winter Tracy Pictures",
|
||||
"zzz =2010.0 Winter Tracy Pictures",
|
||||
"zzz =2010.1 Spring Tracy Pictures",
|
||||
"zzz =2010.2 Summer Tracy Pictures",
|
||||
"zzz =2010.3 Fall Tracy Pictures",
|
||||
"zzz =2011.0 Winter Tracy Pictures",
|
||||
"zzz =2011.1 Spring Tracy Pictures",
|
||||
"zzz =2011.2 Summer Tracy Pictures",
|
||||
"zzz =2011.3 Fall Tracy Pictures",
|
||||
"zzz =2011.4 Winter Tracy Pictures",
|
||||
"zzz =2012.0 Winter Tracy Pictures",
|
||||
"zzz =2012.1 Spring Tracy Pictures",
|
||||
"zzz =2012.2 Summer Tracy Pictures",
|
||||
"zzz =2012.3 Fall Tracy Pictures",
|
||||
"zzz =2012.4 Winter Tracy Pictures",
|
||||
"zzz =2013.0 Winter Tracy Pictures",
|
||||
"zzz =2013.1 Spring Tracy Pictures",
|
||||
"zzz =2013.2 Summer Tracy Pictures",
|
||||
"zzz =2013.3 Fall Tracy Pictures",
|
||||
"zzz =2013.4 Winter Tracy Pictures",
|
||||
"zzz =2014.0 Winter Tracy Pictures",
|
||||
"zzz =2014.1 Spring Tracy Pictures",
|
||||
"zzz =2014.2 Summer Tracy Pictures",
|
||||
"zzz =2014.3 Fall Tracy Pictures",
|
||||
"zzz =2014.4 Winter Tracy Pictures",
|
||||
"zzz =2015.0 Winter Tracy Pictures",
|
||||
"zzz Family Pictures",
|
||||
"zzz Family Pictures",
|
||||
"zzz Family Pictures",
|
||||
"zzz Family Pictures",
|
||||
"zzz GrandPrix",
|
||||
"zzz Motorcycles",
|
||||
"zzz Motorcycles",
|
||||
"zzz Motorcycles",
|
||||
"zzz Parents Yard",
|
||||
"zzz Phares Family Pictures",
|
||||
"zzz Phares Slides ####",
|
||||
"zzz Portrait Innovations April",
|
||||
"zzz Portrait Innovations Files",
|
||||
"zzz Portrait Innovations June",
|
||||
"zzz Portrait Innovations March",
|
||||
"zzz Rex Memorial ####",
|
||||
"zzz Scanned Grandma's Quilt ####",
|
||||
"zzz Scanned Pictures Of Kids ####",
|
||||
"zzz Scanned Prints ####",
|
||||
"zzz Slide in Name Order Originals (622) ####",
|
||||
"zzz Tub",
|
||||
"zzz Vericruz"
|
||||
],
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"xRootDirectory": "F:/Tmp/Phares/Compare/Images 2022-11-12 - c6aa7e8",
|
||||
"xxRootDirectory": "F:/Tmp/Phares/Compare/Not-Copy-Copy-All",
|
||||
"RootDirectory": "E:/",
|
||||
"VerifyToSeason": [
|
||||
". 2000",
|
||||
". 2001",
|
||||
". 2002",
|
||||
". 2003",
|
||||
". 2004",
|
||||
". 2005",
|
||||
". 2006",
|
||||
". 2007",
|
||||
". 2008",
|
||||
". 2009",
|
||||
". 2010",
|
||||
". 2011",
|
||||
". 2012",
|
||||
". 2013",
|
||||
". 2014",
|
||||
". 2015",
|
||||
". 2016",
|
||||
". 2017",
|
||||
". 2018",
|
||||
". 2019",
|
||||
". 2020",
|
||||
". 2021",
|
||||
". 2022",
|
||||
". 2023",
|
||||
". 2024",
|
||||
". 2025",
|
||||
". 2026",
|
||||
". 2027",
|
||||
". 2028",
|
||||
". 2029",
|
||||
"=2000.0 Winter",
|
||||
"=2002.1 Spring",
|
||||
"=2002.4 Winter",
|
||||
"=2003.0 Winter",
|
||||
"=2003.1 Spring",
|
||||
"=2003.3 Fall",
|
||||
"=2003.4 Winter",
|
||||
"=2004.0 Winter",
|
||||
"=2005.1 Spring",
|
||||
"=2005.2 Summer",
|
||||
"=2005.3 Fall",
|
||||
"=2005.4 Winter",
|
||||
"=2006.0 Winter",
|
||||
"=2006.1 Spring",
|
||||
"=2006.3 Fall",
|
||||
"=2007.0 Winter",
|
||||
"=2007.2 Summer Logan Michael",
|
||||
"=2007.2 Summer",
|
||||
"=2007.3 Fall Logan Michael",
|
||||
"=2007.4 Winter Logan Michael",
|
||||
"=2008.0 Winter Logan Michael",
|
||||
"=2008.1 Spring Logan Michael",
|
||||
"=2008.2 Summer Logan Michael",
|
||||
"=2008.2 Summer",
|
||||
"=2008.3 Fall Logan Michael",
|
||||
"=2009.0 Winter Logan Michael",
|
||||
"=2009.0 Winter",
|
||||
"=2009.1 Spring Logan Michael",
|
||||
"=2009.1 Spring",
|
||||
"=2009.2 Summer Logan Michael",
|
||||
"=2009.2 Summer",
|
||||
"=2009.3 Fall Logan Michael",
|
||||
"=2009.3 Fall",
|
||||
"=2009.4 Winter Logan Michael",
|
||||
"=2009.4 Winter",
|
||||
"=2010.0 Winter Logan Michael",
|
||||
"=2010.0 Winter",
|
||||
"=2010.1 Spring Logan Michael",
|
||||
"=2010.1 Spring",
|
||||
"=2010.2 Summer",
|
||||
"=2010.3 Fall Logan Michael",
|
||||
"=2010.3 Fall",
|
||||
"=2010.4 Winter",
|
||||
"=2011.0 Winter",
|
||||
"=2011.1 Spring",
|
||||
"=2011.2 Summer",
|
||||
"=2011.3 Fall",
|
||||
"=2011.4 Winter",
|
||||
"=2012.0 Winter Chelsea 2012",
|
||||
"=2012.0 Winter Chelsea",
|
||||
"=2012.0 Winter",
|
||||
"=2012.1 Spring Chelsea",
|
||||
"=2012.1 Spring",
|
||||
"=2012.2 Summer Chelsea",
|
||||
"=2012.2 Summer",
|
||||
"=2012.3 Fall Chelsea",
|
||||
"=2012.3 Fall",
|
||||
"=2012.4 Winter Chelsea",
|
||||
"=2012.4 Winter",
|
||||
"=2013.0 Winter Chelsea 2013",
|
||||
"=2013.0 Winter Chelsea",
|
||||
"=2013.0 Winter",
|
||||
"=2013.1 Spring",
|
||||
"=2013.2 Summer Chelsea",
|
||||
"=2013.2 Summer",
|
||||
"=2013.3 Fall Chelsea",
|
||||
"=2013.3 Fall",
|
||||
"=2013.4 Winter",
|
||||
"=2014.0 Winter",
|
||||
"=2014.1 Spring",
|
||||
"=2014.2 Summer",
|
||||
"=2014.3 Fall",
|
||||
"=2014.4 Winter",
|
||||
"=2015.0 Winter",
|
||||
"=2015.1 Spring",
|
||||
"=2015.2 Summer",
|
||||
"=2015.3 Fall",
|
||||
"=2015.4 Winter",
|
||||
"=2016.0 Winter",
|
||||
"=2016.1 Spring",
|
||||
"=2016.2 Summer",
|
||||
"=2016.3 Fall",
|
||||
"=2016.4 Winter",
|
||||
"=2017.1 Spring",
|
||||
"=2017.2 Summer",
|
||||
"=2017.3 Fall",
|
||||
"=2017.4 Winter",
|
||||
"=2018.0 Winter",
|
||||
"=2018.1 Spring",
|
||||
"=2018.3 Fall",
|
||||
"=2018.4 Winter",
|
||||
"=2019.0 Winter",
|
||||
"=2019.1 Spring",
|
||||
"=2019.2 Summer",
|
||||
"=2019.3 Fall",
|
||||
"=2019.4 Winter",
|
||||
"=2020.0 Winter",
|
||||
"=2020.1 Spring",
|
||||
"=2020.2 Summer",
|
||||
"=2020.3 Fall",
|
||||
"=2020.4 Winter",
|
||||
"=2021.1 Spring",
|
||||
"=2021.2 Summer",
|
||||
"=2021.3 Fall",
|
||||
"=2021.4 Winter",
|
||||
"=2022.0 Winter",
|
||||
"=2022.1 Spring",
|
||||
"Anthem 2015",
|
||||
"April 2010",
|
||||
"April 2013",
|
||||
"December 2006",
|
||||
"December 2010",
|
||||
"Fall 2005",
|
||||
"Fall 2015",
|
||||
"Fall 2016",
|
||||
"Fall 2017",
|
||||
"Fall 2018",
|
||||
"Fall 2019",
|
||||
"Fall 2020",
|
||||
"Fall 2021",
|
||||
"February 2010",
|
||||
"January 2015",
|
||||
"July 2010",
|
||||
"June 2010",
|
||||
"Kids 2005",
|
||||
"March 2013",
|
||||
"May 2010",
|
||||
"May 2011",
|
||||
"May 2013",
|
||||
"October 2005",
|
||||
"October 2014",
|
||||
"Spring 2013",
|
||||
"Spring 2014",
|
||||
"Spring 2016",
|
||||
"Spring 2018",
|
||||
"Spring 2019",
|
||||
"Spring 2020",
|
||||
"Summer 2011",
|
||||
"Summer 2012",
|
||||
"Summer 2013",
|
||||
"Summer 2014",
|
||||
"Summer 2015",
|
||||
"Summer 2016",
|
||||
"Summer 2017",
|
||||
"Summer 2018",
|
||||
"Summer 2020",
|
||||
"Summer 2021",
|
||||
"Winter 2015",
|
||||
"Winter 2016",
|
||||
"Winter 2017",
|
||||
"Winter 2018",
|
||||
"Winter 2019-2020",
|
||||
"Winter 2020",
|
||||
"zzz =2005.0 Winter Tracy Pictures",
|
||||
"zzz =2005.1 Spring Tracy Pictures",
|
||||
"zzz =2005.2 Summer Tracy Pictures",
|
||||
"zzz =2005.3 Fall Tracy Pictures",
|
||||
"zzz =2005.4 Winter Tracy Pictures",
|
||||
"zzz =2006.1 Spring Tracy Pictures",
|
||||
"zzz =2007.0 Winter Tracy Pictures",
|
||||
"zzz =2007.2 Summer Tracy Pictures",
|
||||
"zzz =2008.0 Winter Tracy Pictures",
|
||||
"zzz =2008.2 Summer Tracy Pictures",
|
||||
"zzz =2009.0 Winter Tracy Pictures",
|
||||
"zzz =2009.2 Summer Tracy Pictures",
|
||||
"zzz =2009.3 Fall Tracy Pictures",
|
||||
"zzz =2009.4 Winter Tracy Pictures",
|
||||
"zzz =2010.0 Winter Tracy Pictures",
|
||||
"zzz =2010.1 Spring Tracy Pictures",
|
||||
"zzz =2010.2 Summer Tracy Pictures",
|
||||
"zzz =2010.3 Fall Tracy Pictures",
|
||||
"zzz =2011.0 Winter Tracy Pictures",
|
||||
"zzz =2011.1 Spring Tracy Pictures",
|
||||
"zzz =2011.2 Summer Tracy Pictures",
|
||||
"zzz =2011.3 Fall Tracy Pictures",
|
||||
"zzz =2011.4 Winter Tracy Pictures",
|
||||
"zzz =2012.0 Winter Tracy Pictures",
|
||||
"zzz =2012.1 Spring Tracy Pictures",
|
||||
"zzz =2012.2 Summer Tracy Pictures",
|
||||
"zzz =2012.3 Fall Tracy Pictures",
|
||||
"zzz =2012.4 Winter Tracy Pictures",
|
||||
"zzz =2013.0 Winter Tracy Pictures",
|
||||
"zzz =2013.1 Spring Tracy Pictures",
|
||||
"zzz =2013.2 Summer Tracy Pictures",
|
||||
"zzz =2013.3 Fall Tracy Pictures",
|
||||
"zzz =2013.4 Winter Tracy Pictures",
|
||||
"zzz =2014.0 Winter Tracy Pictures",
|
||||
"zzz =2014.1 Spring Tracy Pictures",
|
||||
"zzz =2014.2 Summer Tracy Pictures",
|
||||
"zzz =2014.3 Fall Tracy Pictures",
|
||||
"zzz =2014.4 Winter Tracy Pictures",
|
||||
"zzz =2015.0 Winter Tracy Pictures"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
119
Duplicate-Search/appsettings.json
Normal file
119
Duplicate-Search/appsettings.json
Normal file
@ -0,0 +1,119 @@
|
||||
{
|
||||
"Company": "Mike Phares",
|
||||
"IndexOnly": false,
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 6,
|
||||
"Reverse": false,
|
||||
"SortContainers": true,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Information",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"DateGroup": "2022-11-12",
|
||||
"DiffPropertyDirectory": "",
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||
"OutputExtension": ".jpg",
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PopulatePropertyId": true,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"ResultAllInOne": "_ _ _",
|
||||
"ResultCollection": "[]",
|
||||
"ResultContent": "()",
|
||||
"ResultSingleton": "{}",
|
||||
"RootDirectory": "C:/Tmp/Phares/Compare/Images 2022-11-12 - c6aa7e8",
|
||||
"WriteBitmapDataBytes": false,
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF"
|
||||
],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidMetadataExtensions": [
|
||||
".3gp",
|
||||
".3GP",
|
||||
".avi",
|
||||
".AVI",
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".ico",
|
||||
".ICO",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".m4v",
|
||||
".M4V",
|
||||
".mov",
|
||||
".MOV",
|
||||
".mp4",
|
||||
".MP4",
|
||||
".mta",
|
||||
".MTA",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user