diff --git a/.vscode/launch.json b/.vscode/launch.json index a5a016e..cbd086b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -142,6 +142,23 @@ "stopAtEntry": false, "requireExactSource": false }, + { + "name": "Move-By-Id", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/Move-By-Id/bin/Debug/net7.0/win-x64/Move-By-Id.dll", + "args": [ + "s" + ], + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "cwd": "${workspaceFolder}", + "console": "externalTerminal", + "stopAtEntry": false, + "requireExactSource": false + }, { "name": "Not-Copy-Copy", "type": "coreclr", diff --git a/Delete-By-Distinct/appsettings.Development.json b/Delete-By-Distinct/appsettings.Development.json index 475b9b8..153fe71 100644 --- a/Delete-By-Distinct/appsettings.Development.json +++ b/Delete-By-Distinct/appsettings.Development.json @@ -1,12 +1,12 @@ { - "CompareRootDirectory": "D:/7) Question/- - - Images - 2023-01-12/d02c8791fa0b130c0bce2d39ee684e50f7ee7a97-Not-Copy-Copy", + "CompareRootDirectory": "D:/2) Images B/Not-Copy-Copy-45f4401", "Logging": { "LogLevel": { "Log4netProvider": "Debug" } }, "MaxDegreeOfParallelism": 6, - "RecycleOption": false, + "RecycleOption": true, "SearchPattern": "*.*", "Serilog": { "MinimumLevel": "Debug" @@ -15,12 +15,11 @@ "Configuration": { "xRootDirectory": "D:/2) Images B/Corrupt", "xxRootDirectory": "D:/2) Images B/Not-Copy-Copy-45f4401", - "xxxRootDirectory": "D:/1) Images A/Images-45f4401", + "RootDirectory": "D:/1) Images A/Images-45f4401", "xxxxRootDirectory": "E:/3) Videos A/Device Videos 2_0_0_3 - Current", "xxxxxRootDirectory": "E:/4) Videos B/Device Videos 2_0_0_3 - Current - Ignore", "xxxxxxRootDirectory": "C:/1) Images A/Images-45f4401", "xxxxxxxRootDirectory": "C:/2) Images B/Not-Copy-Copy-45f4401", - "xxxxxxxxRootDirectory": "D:/7) Question/- - - Images - 2023-01-12/fa60aa45ebb55fe3ee0ce4da8a64e40611e7d5ce", "VerifyToSeason": [] } } diff --git a/Move-By-Id/.vscode/launch.json b/Move-By-Id/.vscode/launch.json new file mode 100644 index 0000000..5c7c6b4 --- /dev/null +++ b/Move-By-Id/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "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/net7.0/win-x64/Rename.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/Move-By-Id/.vscode/tasks.json b/Move-By-Id/.vscode/tasks.json new file mode 100644 index 0000000..c51ceb7 --- /dev/null +++ b/Move-By-Id/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Rename.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/Rename.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/Rename.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Move-By-Id/Models/AppSettings.cs b/Move-By-Id/Models/AppSettings.cs new file mode 100644 index 0000000..8b05e92 --- /dev/null +++ b/Move-By-Id/Models/AppSettings.cs @@ -0,0 +1,38 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace View_by_Distance.Move.By.Id.Models; + +public class AppSettings +{ + + public string Company { init; get; } + public string MoveTo { init; get; } + public string ComparePathsFile { init; get; } + public int MaxDegreeOfParallelism { init; get; } + public int MaxMinutesDelta { init; get; } + public string WorkingDirectoryName { init; get; } + + [JsonConstructor] + public AppSettings(string company, + string moveTo, + string comparePathsFile, + int maxDegreeOfParallelism, + int maxMinutesDelta, + string workingDirectoryName) + { + Company = company; + MoveTo = moveTo; + ComparePathsFile = comparePathsFile; + MaxDegreeOfParallelism = maxDegreeOfParallelism; + MaxMinutesDelta = maxMinutesDelta; + WorkingDirectoryName = workingDirectoryName; + } + + public override string ToString() + { + string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); + return result; + } + +} \ No newline at end of file diff --git a/Move-By-Id/Models/Binder/AppSettings.cs b/Move-By-Id/Models/Binder/AppSettings.cs new file mode 100644 index 0000000..6907b44 --- /dev/null +++ b/Move-By-Id/Models/Binder/AppSettings.cs @@ -0,0 +1,52 @@ +using Microsoft.Extensions.Configuration; +using System.Text.Json; + +namespace View_by_Distance.Move.By.Id.Models.Binder; + +public class AppSettings +{ + +#nullable disable + + public string Company { get; set; } + public string MoveTo { get; set; } + public string ComparePathsFile { get; set; } + public int? MaxDegreeOfParallelism { get; set; } + public int? MaxMinutesDelta { 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?.MaxDegreeOfParallelism is null) + throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism)); + if (appSettings?.MaxMinutesDelta is null) + throw new NullReferenceException(nameof(appSettings.MaxMinutesDelta)); + result = new( + appSettings.Company, + appSettings.MoveTo, + appSettings.ComparePathsFile, + appSettings.MaxDegreeOfParallelism.Value, + appSettings.MaxMinutesDelta.Value, + appSettings.WorkingDirectoryName + ); + return result; + } + + public static Models.AppSettings Get(IConfigurationRoot configurationRoot) + { + Models.AppSettings result; + AppSettings? appSettings = configurationRoot.Get(); + result = Get(appSettings); + return result; + } + +} \ No newline at end of file diff --git a/Move-By-Id/Models/Binder/Configuration.cs b/Move-By-Id/Models/Binder/Configuration.cs new file mode 100644 index 0000000..8c11d1f --- /dev/null +++ b/Move-By-Id/Models/Binder/Configuration.cs @@ -0,0 +1,59 @@ +using Microsoft.Extensions.Configuration; +using Phares.Shared; +using System.ComponentModel.DataAnnotations; +using System.Text.Json; + +namespace View_by_Distance.Move.By.Id.Models.Binder; + +public class Configuration +{ + +#nullable disable + + [Display(Name = "Ignore Extensions"), Required] public string[] IgnoreExtensions { get; set; } + [Display(Name = "Property Configuration"), Required] public Property.Models.Configuration PropertyConfiguration { get; set; } + [Display(Name = "Person Birthday Format"), Required] public string PersonBirthdayFormat { get; set; } + +#nullable restore + + public override string ToString() + { + string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); + return result; + } + + private static Models.Configuration Get(Configuration? configuration) + { + Models.Configuration result; + if (configuration is null) + throw new NullReferenceException(nameof(configuration)); + if (configuration.IgnoreExtensions is null) + throw new NullReferenceException(nameof(configuration.IgnoreExtensions)); + if (configuration.PersonBirthdayFormat is null) + throw new NullReferenceException(nameof(configuration.PersonBirthdayFormat)); + result = new( + configuration.IgnoreExtensions, + configuration.PersonBirthdayFormat, + configuration.PropertyConfiguration); + return result; + } + + public static Models.Configuration Get(IsEnvironment isEnvironment, IConfigurationRoot configurationRoot, Property.Models.Configuration propertyConfiguration) + { + Models.Configuration result; + Configuration? configuration; + if (isEnvironment is null) + configuration = configurationRoot.Get(); + else + { + string environmentName = IsEnvironment.GetEnvironmentName(isEnvironment); + string section = string.Concat(environmentName, ":", nameof(Configuration)); + IConfigurationSection configurationSection = configurationRoot.GetSection(section); + configuration = configurationSection.Get(); + } + result = Get(configuration); + result.SetAndUpdate(propertyConfiguration); + return result; + } + +} \ No newline at end of file diff --git a/Move-By-Id/Models/Configuration.cs b/Move-By-Id/Models/Configuration.cs new file mode 100644 index 0000000..776bb93 --- /dev/null +++ b/Move-By-Id/Models/Configuration.cs @@ -0,0 +1,38 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace View_by_Distance.Move.By.Id.Models; + +public class Configuration +{ + + protected Property.Models.Configuration _PropertyConfiguration; + public string[] IgnoreExtensions { init; get; } + public string PersonBirthdayFormat { init; get; } + + public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration; + + [JsonConstructor] + public Configuration( + string[] ignoreExtensions, + string personBirthdayFormat, + Property.Models.Configuration propertyConfiguration) + { + IgnoreExtensions = ignoreExtensions; + PersonBirthdayFormat = personBirthdayFormat; + _PropertyConfiguration = propertyConfiguration; + } + + public override string ToString() + { + string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); + return result; + } + + public void SetAndUpdate(Property.Models.Configuration configuration) + { + _PropertyConfiguration = configuration; + _PropertyConfiguration.Update(); + } + +} \ No newline at end of file diff --git a/Move-By-Id/Models/Stateless/SerilogExtensionMethods.cs b/Move-By-Id/Models/Stateless/SerilogExtensionMethods.cs new file mode 100644 index 0000000..386b1fd --- /dev/null +++ b/Move-By-Id/Models/Stateless/SerilogExtensionMethods.cs @@ -0,0 +1,10 @@ +namespace View_by_Distance.Move.By.Id.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); + +} \ No newline at end of file diff --git a/Move-By-Id/Move-By-Id.csproj b/Move-By-Id/Move-By-Id.csproj new file mode 100644 index 0000000..6802186 --- /dev/null +++ b/Move-By-Id/Move-By-Id.csproj @@ -0,0 +1,60 @@ + + + enable + 10.0 + enable + WinExe + win-x64 + net7.0 + + + Phares.View.by.Distance.Move.By.Id + false + 7.0.101.1 + Mike Phares + Phares + true + snupkg + + + true + true + true + + + Windows + + + OSX + + + Linux + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + \ No newline at end of file diff --git a/Move-By-Id/MoveById.cs b/Move-By-Id/MoveById.cs new file mode 100644 index 0000000..ae88a51 --- /dev/null +++ b/Move-By-Id/MoveById.cs @@ -0,0 +1,186 @@ +using Microsoft.Extensions.Configuration; +using Phares.Shared; +using Serilog; +using ShellProgressBar; +using View_by_Distance.Move.By.Id.Models; +using View_by_Distance.Shared.Models; +using View_by_Distance.Shared.Models.Methods; + +namespace View_by_Distance.Move.By.Id; + +public class MoveById +{ + + private readonly AppSettings _AppSettings; + private readonly string _WorkingDirectory; + private readonly IsEnvironment _IsEnvironment; + private readonly Configuration _Configuration; + private readonly IConfigurationRoot _ConfigurationRoot; + private readonly Property.Models.Configuration _PropertyConfiguration; + + public MoveById(List args, IsEnvironment isEnvironment, IConfigurationRoot configurationRoot, AppSettings appSettings, string workingDirectory, bool isSilent, IConsole console) + { + if (isSilent) + { } + if (console is null) + { } + _AppSettings = appSettings; + _IsEnvironment = isEnvironment; + _WorkingDirectory = workingDirectory; + _ConfigurationRoot = configurationRoot; + ILogger? log = Log.ForContext(); + Property.Models.Configuration propertyConfiguration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot); + Configuration configuration = Models.Binder.Configuration.Get(isEnvironment, configurationRoot, propertyConfiguration); + _PropertyConfiguration = propertyConfiguration; + _Configuration = configuration; + ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true }; + propertyConfiguration.Update(); + string? comparePathRoot = Path.GetDirectoryName(appSettings.ComparePathsFile); + if (comparePathRoot is null || comparePathRoot == propertyConfiguration.RootDirectory) + throw new Exception("Nested isn't allowed!"); + log.Information(propertyConfiguration.RootDirectory); + Verify(); + string json = File.ReadAllText(appSettings.ComparePathsFile); + MatchNginx[]? matchNginxCollection = System.Text.Json.JsonSerializer.Deserialize(json); + if (matchNginxCollection is null) + throw new NullReferenceException(nameof(matchNginxCollection)); + if (matchNginxCollection.Any()) + { + List lines = MoveFilesByIdInDirectories(options, matchNginxCollection); + File.WriteAllLines($"D:/Tmp/Phares/{DateTime.Now.Ticks}.tsv", lines); + if (comparePathRoot != Path.GetPathRoot(matchNginxCollection[0].ConvertedPath)) + _ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(comparePathRoot); + } + } + + private void Verify() + { + if (_AppSettings is null) + { } + if (_IsEnvironment is null) + { } + if (_Configuration is null) + { } + if (_ConfigurationRoot is null) + { } + if (_WorkingDirectory is null) + { } + } + + private static List GetAllFiles(MatchNginx[] matchNginxCollection) + { + List allFiles = new(); + string[] files; + string directoryName; + ReadOnlySpan span; + foreach (MatchNginx matchNginx in matchNginxCollection) + { + if (matchNginx.ConvertedPath.Length < 6) + continue; + directoryName = Path.GetFileName(matchNginx.ConvertedPath); + if (matchNginx.ConvertedPath.Contains("!---")) + span = "0"; + else + span = matchNginx.ConvertedPath.AsSpan(matchNginx.ConvertedPath.Length - 5, 3); + if (directoryName.Length == 1 && int.TryParse(span, out int age)) + continue; + if (File.Exists(matchNginx.ConvertedPath)) + continue; + files = Directory.GetFiles(matchNginx.ConvertedPath, "*", SearchOption.AllDirectories); + if (files.All(l => l.EndsWith(".id"))) + { + foreach (string file in files) + File.Delete(file); + continue; + } + allFiles.AddRange(files); + } + return allFiles; + } + + private List GetToDoCollection(ProgressBar progressBar, List allFiles) + { + List results = new(); + int? id; + string? message; + string[] matches; + DateTime?[] dateTimes; + FileHolder fileHolder; + bool isIgnoreExtension; + const string jpeg = ".jpeg"; + bool isValidImageFormatExtension; + bool nameWithoutExtensionIsIdFormat; + foreach (string file in allFiles) + { + progressBar.Tick(); + fileHolder = new(file); + if (fileHolder.ExtensionLowered == ".id" || fileHolder.DirectoryName is null) + continue; + if (allFiles.Contains($"{fileHolder.FullName}.id")) + continue; + isValidImageFormatExtension = _PropertyConfiguration.ValidImageFormatExtensions.Contains(fileHolder.ExtensionLowered); + isIgnoreExtension = isValidImageFormatExtension && _Configuration.IgnoreExtensions.Contains(fileHolder.ExtensionLowered); + nameWithoutExtensionIsIdFormat = Shared.Models.Stateless.Methods.IProperty.NameWithoutExtensionIsIdFormat(fileHolder); + if (!isIgnoreExtension && isValidImageFormatExtension) + { + if (fileHolder.ExtensionLowered == jpeg) + continue; + if (nameWithoutExtensionIsIdFormat) + continue; + } + (dateTimes, id, message) = Shared.Models.Stateless.Methods.IProperty.Get(fileHolder, isIgnoreExtension, isValidImageFormatExtension); + if (id is null) + continue; + matches = (from l in allFiles where l.Contains($"{id}{fileHolder.ExtensionLowered}") select l).ToArray(); + if (!matches.Any()) + continue; + results.Add(fileHolder.FullName); + results.AddRange(matches); + } + return results; + } + + private static void CreateDirectories(List directories) + { + foreach (string directory in directories) + { + if (Directory.Exists(directory)) + continue; + _ = Directory.CreateDirectory(directory); + } + } + + private List MoveFilesByIdInDirectories(ProgressBarOptions options, MatchNginx[] matchNginxCollection) + { + List results = new(); + string moveTo; + string? directory; + string message = "Moving allFiles"; + List distinctDirectories = new(); + List allFiles = GetAllFiles(matchNginxCollection); + ProgressBar progressBar = new(allFiles.Count, message, options); + List toDoCollection = GetToDoCollection(progressBar, allFiles); + List<(string, string)> moveCollection = new(); + foreach (string file in toDoCollection) + { + moveTo = $"{_AppSettings.MoveTo}{file[1..]}"; + directory = Path.GetDirectoryName(moveTo); + if (directory is null) + continue; + moveCollection.Add(new(file, moveTo)); + if (distinctDirectories.Contains(directory)) + continue; + distinctDirectories.Add(directory); + } + CreateDirectories(distinctDirectories); + foreach ((string from, string to) in moveCollection) + { + if (File.Exists(to)) + continue; + File.Move(from, to); + } + progressBar.Dispose(); + return results; + } + +} \ No newline at end of file diff --git a/Move-By-Id/Program.cs b/Move-By-Id/Program.cs new file mode 100644 index 0000000..c917231 --- /dev/null +++ b/Move-By-Id/Program.cs @@ -0,0 +1,70 @@ +using Microsoft.Extensions.Configuration; +using Phares.Shared; +using Serilog; +using System.Diagnostics; +using System.Reflection; +using View_by_Distance.Move.By.Id.Models; +using View_by_Distance.Shared.Models.Stateless.Methods; + +namespace View_by_Distance.Move.By.Id; + +public class Program +{ + + public static void Secondary(List 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(); + 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 MoveById(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()); + } + +} \ No newline at end of file diff --git a/Move-By-Id/appsettings.Development.json b/Move-By-Id/appsettings.Development.json new file mode 100644 index 0000000..93a5183 --- /dev/null +++ b/Move-By-Id/appsettings.Development.json @@ -0,0 +1,20 @@ +{ + "ComparePathsFile": "C:/Users/mikep/AppData/Local/PharesApps/Drag-Drop-Explorer/2023_05/638105806929278358.json", + "MoveTo": "L", + "Logging": { + "LogLevel": { + "Log4netProvider": "Debug" + } + }, + "MaxDegreeOfParallelism": 6, + "MaxMinutesDelta": 2, + "Serilog": { + "MinimumLevel": "Debug" + }, + "Windows": { + "Configuration": { + "RootDirectory": "C:/", + "VerifyToSeason": [] + } + } +} \ No newline at end of file diff --git a/Move-By-Id/appsettings.json b/Move-By-Id/appsettings.json new file mode 100644 index 0000000..a9308b2 --- /dev/null +++ b/Move-By-Id/appsettings.json @@ -0,0 +1,120 @@ +{ + "ComparePathsFile": "", + "Company": "Mike Phares", + "MoveTo": "", + "Linux": {}, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Log4netProvider": "Debug", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "MaxDegreeOfParallelism": 6, + "MaxMinutesDelta": 2, + "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": "45f4401", + "DiffPropertyDirectory": "", + "FileNameDirectorySeparator": ".Z.", + "ForcePropertyLastWriteTimeToCreationTime": false, + "MaxImagesInDirectoryForTopLevelFirstPass": 10, + "OutputExtension": ".jpg", + "Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]", + "PersonBirthdayFormat": "yyyy-MM-dd_HH", + "PopulatePropertyId": true, + "PropertiesChangedForProperty": false, + "ResultAllInOne": "_ _ _", + "ResultCollection": "[]", + "ResultContent": "()", + "ResultSingleton": "{}", + "RootDirectory": "C:/Tmp/Phares/Compare/Images-45f4401", + "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" + ] + } + } +} \ No newline at end of file diff --git a/View-by-Distance-MKLink-Console.sln b/View-by-Distance-MKLink-Console.sln index d3d4524..cd38563 100644 --- a/View-by-Distance-MKLink-Console.sln +++ b/View-by-Distance-MKLink-Console.sln @@ -49,6 +49,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestsWithFaceRecognitionDot EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "View-by-Distance.Shared", "shared\View-by-Distance.Shared.csproj", "{1D231660-33B4-4763-9C9F-C6ACC8BA600D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Move-By-Id", "Move-By-Id\Move-By-Id.csproj", "{0FDFBC71-3801-483F-A4AC-CC8CF857D54F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -150,5 +152,9 @@ Global {83FD089F-8034-4597-B87F-87D343C0486B}.Debug|Any CPU.Build.0 = Debug|Any CPU {83FD089F-8034-4597-B87F-87D343C0486B}.Release|Any CPU.ActiveCfg = Release|Any CPU {83FD089F-8034-4597-B87F-87D343C0486B}.Release|Any CPU.Build.0 = Release|Any CPU + {0FDFBC71-3801-483F-A4AC-CC8CF857D54F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FDFBC71-3801-483F-A4AC-CC8CF857D54F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FDFBC71-3801-483F-A4AC-CC8CF857D54F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FDFBC71-3801-483F-A4AC-CC8CF857D54F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal