SaveShortcutsForOutputResolutions

This commit is contained in:
2023-01-02 20:22:27 -07:00
parent d0cd52807d
commit 92288c9381
7 changed files with 252 additions and 143 deletions

View File

@ -36,7 +36,7 @@ public class Rename
_PropertyConfiguration = propertyConfiguration;
_Configuration = configuration;
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
propertyConfiguration.Update();
propertyConfiguration.Update();
string? comparePathRoot = Path.GetDirectoryName(appSettings.ComparePathsFile);
if (comparePathRoot is null || comparePathRoot == propertyConfiguration.RootDirectory)
throw new Exception("Nested isn't allowed!");
@ -244,14 +244,16 @@ public class Rename
{
List<string> results = new();
string[] files;
string message;
int distinctCount;
string message = "Renaming files";
ProgressBar progressBar;
List<(FileHolder, string)> renameCollection;
List<string> allFiles = GetAllFiles(matchNginxCollection);
using ProgressBar progressBar = new(matchNginxCollection.Length * 2, message, options);
for (int i = 1; i < 3; i++)
{
message = $"{i}) Renaming files";
files = i == 2 ? allFiles.ToArray() : (from l in allFiles where l.Contains("Rename") select l).ToArray();
progressBar = new(files.Length, message, options);
(renameCollection, distinctCount) = RenameFilesInDirectory(progressBar, files);
foreach ((FileHolder fileHolder, string to) in renameCollection)
{
@ -263,6 +265,7 @@ public class Rename
File.Move(fileHolder.FullName, to);
File.WriteAllText($"{to}.id", $"{to}{Environment.NewLine}{fileHolder.FullName}");
}
progressBar.Dispose();
}
return results;
}