CombinedEnumAndIndex
This commit is contained in:
@ -26,7 +26,7 @@ internal abstract class Container
|
||||
continue;
|
||||
results.Add(item);
|
||||
}
|
||||
return container.Items.Count == results.Count ? container.Items : new(results);
|
||||
return container.Items.Count == results.Count ? container.Items : results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static List<Models.FilePair> GetFilePairs(Properties.IPropertyConfiguration propertyConfiguration, string directorySearchFilter, string extension, string aPropertySingletonDirectory, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection)
|
||||
@ -71,6 +71,22 @@ internal abstract class Container
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void MoveIf(string fileName, CombinedEnumAndIndex cei, string directory, string fullFileName)
|
||||
{
|
||||
string[] segments = directory.Split(cei.Combined);
|
||||
string? checkDirectory = segments.Length == 1 ?
|
||||
Path.Combine(segments[0], $"{cei.Combined[2..]}") :
|
||||
segments.Length == 2 ?
|
||||
$"{segments[0]}{cei.Combined[2..]}{segments[1]}" :
|
||||
null;
|
||||
if (checkDirectory is not null && Directory.Exists(checkDirectory))
|
||||
{
|
||||
string checkFile = Path.Combine(checkDirectory, fileName);
|
||||
if (File.Exists(checkFile))
|
||||
File.Move(checkFile, fullFileName);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ParallelFor(IDlibDotNet? dlibDotNet, Properties.IPropertyConfiguration propertyConfiguration, string aPropertySingletonDirectory, string extension, int rootDirectoryLength, ReadOnlyDictionary<int, Identifier>? splatNineIdentifiers, Models.FilePair filePair, List<FilePair> results)
|
||||
{
|
||||
dlibDotNet?.Tick();
|
||||
@ -108,8 +124,12 @@ internal abstract class Container
|
||||
else
|
||||
{
|
||||
string fileName = Path.GetFileName(filePair.Path);
|
||||
(string directoryName, _) = IPath.GetDirectoryNameAndIndex(propertyConfiguration, filePath);
|
||||
sourceDirectoryFileHolder = IFileHolder.Get(Path.Combine(aPropertySingletonDirectory, directoryName, $"{fileName}{extension}"));
|
||||
CombinedEnumAndIndex cei = IPath.GetCombinedEnumAndIndex(propertyConfiguration, filePath);
|
||||
string directory = Path.Combine(aPropertySingletonDirectory, cei.Combined);
|
||||
string jsonFileName = $"{fileName}{extension}";
|
||||
string fullFileName = Path.Combine(directory, jsonFileName);
|
||||
MoveIf(jsonFileName, cei, directory, fullFileName);
|
||||
sourceDirectoryFileHolder = IFileHolder.Get(fullFileName);
|
||||
}
|
||||
if (sourceDirectoryFileHolder.CreationTime is not null && sourceDirectoryFileHolder.LastWriteTime is not null && filePath.LastWriteTicks != sourceDirectoryFileHolder.CreationTime.Value.Ticks)
|
||||
{
|
||||
@ -183,7 +203,7 @@ internal abstract class Container
|
||||
Models.Container[] results;
|
||||
const string directorySearchFilter = "*";
|
||||
(_, results) = GetContainers(dlibDotNet, propertyConfiguration, aPropertySingletonDirectory, filesCollectionDirectory, splatNineIdentifiers, filePathsCollection, directorySearchFilter);
|
||||
return new(results);
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
internal static (int, Models.Container[]) GetContainers(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyDictionary<int, Identifier>? splatNineIdentifiers, string aPropertySingletonDirectory)
|
||||
@ -276,7 +296,7 @@ internal abstract class Container
|
||||
results.Add(item);
|
||||
}
|
||||
}
|
||||
return new(results);
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
}
|
@ -30,14 +30,14 @@ public interface IDirectory
|
||||
static void MoveFiles(List<string> files, string find, string replace) =>
|
||||
XDirectory.MoveFiles(files, find, replace);
|
||||
|
||||
(string[], List<(FilePath, string)>) TestStatic_GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyCollection<string>> fileGroups, Action? tick) =>
|
||||
(string[], List<(FilePath, string)>) TestStatic_GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups, Action? tick) =>
|
||||
GetToDoCollection(propertyConfiguration, filePathsCollection, fileGroups, tick);
|
||||
static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyCollection<string>> fileGroups, Action? tick) =>
|
||||
static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups, Action? tick) =>
|
||||
XDirectory.GetToDoCollection(propertyConfiguration, copyDuplicates: false, ifCanUseId: true, filePathsCollection, fileGroups, tick);
|
||||
|
||||
(string[], List<(FilePath, string)>) TestStatic_GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyCollection<string>> fileGroups, Action? tick) =>
|
||||
(string[], List<(FilePath, string)>) TestStatic_GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups, Action? tick) =>
|
||||
GetToDoCollection(propertyConfiguration, copyDuplicates, ifCanUseId, filePathsCollection, fileGroups, tick);
|
||||
static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyCollection<string>> fileGroups, Action? tick) =>
|
||||
static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups, Action? tick) =>
|
||||
XDirectory.GetToDoCollection(propertyConfiguration, copyDuplicates, ifCanUseId, filePathsCollection, fileGroups, tick);
|
||||
|
||||
List<string> TestStatic_CopyOrMove(List<(FilePath, string)> toDoCollection, bool move, bool moveBack, Action? tick) =>
|
||||
|
@ -62,14 +62,14 @@ public interface IPath
|
||||
static string GetDirectory(string sourceDirectory, int level, string directoryName) =>
|
||||
XPath.GetDirectory(sourceDirectory, level, directoryName);
|
||||
|
||||
(string, int) TestStatic_GetDirectoryNameAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||
GetDirectoryNameAndIndex(propertyConfiguration, filePath);
|
||||
static (string, int) GetDirectoryNameAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||
XPath.GetDirectoryNameAndIndex(propertyConfiguration, filePath);
|
||||
CombinedEnumAndIndex TestStatic_GetCombinedEnumAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||
GetCombinedEnumAndIndex(propertyConfiguration, filePath);
|
||||
static CombinedEnumAndIndex GetCombinedEnumAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||
XPath.GetCombinedEnumAndIndex(propertyConfiguration, filePath);
|
||||
|
||||
ReadOnlyDictionary<string, ReadOnlyCollection<string>> TestStatic_GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups) =>
|
||||
ReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> TestStatic_GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups) =>
|
||||
GetKeyValuePairs(propertyConfiguration, resultsFullGroupDirectory, jsonGroups);
|
||||
static ReadOnlyDictionary<string, ReadOnlyCollection<string>> GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups) =>
|
||||
static ReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups) =>
|
||||
XPath.GetKeyValuePairs(propertyConfiguration, resultsFullGroupDirectory, jsonGroups);
|
||||
|
||||
}
|
@ -75,13 +75,15 @@ internal abstract class Property
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
check = Path.GetDirectoryName(check);
|
||||
if (string.IsNullOrEmpty(check) || check == pathRoot)
|
||||
if (string.IsNullOrEmpty(check))
|
||||
break;
|
||||
directoryName = Path.GetFileName(check);
|
||||
directorySegments = directoryName.Split(' ');
|
||||
(result, results) = IsWrongYear(directorySegments, year);
|
||||
if (result is not null)
|
||||
break;
|
||||
if (check == pathRoot)
|
||||
break;
|
||||
}
|
||||
if (result is not null && !result.Value)
|
||||
break;
|
||||
|
@ -51,7 +51,7 @@ internal abstract partial class XDirectory
|
||||
int ceilingAverage = directory[^1] == '_' || results.Count == 0 ? 0 : GetCeilingAverage(results);
|
||||
if (useCeilingAverage)
|
||||
results = GetFilesCollection(results, ceilingAverage);
|
||||
return new(results);
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
internal static ReadOnlyCollection<ReadOnlyCollection<FilePath>> GetFilePathCollections(Properties.IPropertyConfiguration propertyConfiguration, string directorySearchFilter, string fileSearchFilter, string directory, bool useCeilingAverage)
|
||||
@ -326,10 +326,10 @@ internal abstract partial class XDirectory
|
||||
}
|
||||
results.Add(new(filePaths));
|
||||
}
|
||||
return new(results);
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
internal static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyCollection<string>> fileGroups, Action? tick)
|
||||
internal static (string[], List<(FilePath, string)>) GetToDoCollection(Properties.IPropertyConfiguration propertyConfiguration, bool copyDuplicates, bool ifCanUseId, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups, Action? tick)
|
||||
{
|
||||
List<(FilePath, string)> results = [];
|
||||
string key;
|
||||
@ -338,18 +338,18 @@ internal abstract partial class XDirectory
|
||||
string directory;
|
||||
FileInfo fileInfo;
|
||||
FilePath filePath;
|
||||
int directoryIndex;
|
||||
string paddedIdFile;
|
||||
bool wrapped = false;
|
||||
string intelligentId;
|
||||
CombinedEnumAndIndex cei;
|
||||
bool paddedCheck = false;
|
||||
string fileDirectoryName;
|
||||
List<int> distinctIds = [];
|
||||
List<string> distinct = [];
|
||||
Models.FileHolder fileHolder;
|
||||
List<string> distinctDirectories = [];
|
||||
ReadOnlyCollection<string>? directories;
|
||||
FilePath[] sortedRecords = GetSortedRecords(filePathsCollection);
|
||||
ReadOnlyDictionary<byte, ReadOnlyCollection<string>>? keyValuePairs;
|
||||
bool isOffsetDeterministicHashCode = IId.IsOffsetDeterministicHashCode(propertyConfiguration);
|
||||
for (int i = 0; i < sortedRecords.Length; i++)
|
||||
{
|
||||
@ -358,21 +358,21 @@ internal abstract partial class XDirectory
|
||||
if (filePath.Name.EndsWith("len") || filePath.ExtensionLowered == ".id" || filePath.ExtensionLowered == ".lsv" || filePath.DirectoryFullPath is null)
|
||||
continue;
|
||||
key = propertyConfiguration.ValidVideoFormatExtensions.Contains(filePath.ExtensionLowered) ? propertyConfiguration.ResultContentCollection : propertyConfiguration.ResultContent;
|
||||
if (!fileGroups.TryGetValue(key, out directories))
|
||||
if (!fileGroups.TryGetValue(key, out keyValuePairs))
|
||||
continue;
|
||||
(_, directoryIndex) = IPath.GetDirectoryNameAndIndex(propertyConfiguration, filePath);
|
||||
cei = IPath.GetCombinedEnumAndIndex(propertyConfiguration, filePath);
|
||||
fileDirectoryName = Path.GetFileName(filePath.DirectoryFullPath);
|
||||
if (fileDirectoryName.Length < propertyConfiguration.ResultAllInOneSubdirectoryLength + 3 || !filePath.Name.StartsWith(fileDirectoryName))
|
||||
{
|
||||
if (wrapped)
|
||||
continue;
|
||||
directory = directories[directoryIndex];
|
||||
directory = keyValuePairs[cei.Enum][cei.Index];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!wrapped)
|
||||
wrapped = true;
|
||||
directory = Path.Combine(directories[directoryIndex], fileDirectoryName);
|
||||
directory = Path.Combine(keyValuePairs[cei.Enum][cei.Index], fileDirectoryName);
|
||||
}
|
||||
if (ifCanUseId && filePath.IsIntelligentIdFormat && filePath.Id is not null && filePath.DirectoryFullPath is not null)
|
||||
{
|
||||
|
@ -266,78 +266,155 @@ internal abstract class XPath
|
||||
}
|
||||
}
|
||||
|
||||
internal static (string, int) GetDirectoryNameAndIndex(int resultAllInOneSubdirectoryLength, string fileName)
|
||||
private static byte GetEnum(bool? ik, bool? dto)
|
||||
{
|
||||
byte result;
|
||||
if (ik is not null && ik.Value && dto is not null && dto.Value)
|
||||
result = 11;
|
||||
else if (ik is not null && ik.Value && dto is not null && !dto.Value)
|
||||
result = 15;
|
||||
else if (ik is not null && ik.Value && dto is null)
|
||||
result = 19;
|
||||
else if (ik is not null && !ik.Value && dto is not null && dto.Value)
|
||||
result = 51;
|
||||
else if (ik is not null && !ik.Value && dto is not null && !dto.Value)
|
||||
result = 55;
|
||||
else if (ik is not null && !ik.Value && dto is null)
|
||||
result = 59;
|
||||
else if (ik is null && dto is not null && dto.Value)
|
||||
result = 91;
|
||||
else if (ik is null && dto is not null && !dto.Value)
|
||||
result = 95;
|
||||
else if (ik is null && dto is null)
|
||||
result = 99;
|
||||
else
|
||||
throw new Exception();
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static CombinedEnumAndIndex GetCombinedEnumAndIndex(int resultAllInOneSubdirectoryLength, FilePath filePath, string fileName)
|
||||
{
|
||||
CombinedEnumAndIndex result;
|
||||
int converted;
|
||||
string result;
|
||||
string check = fileName.Length < resultAllInOneSubdirectoryLength ? new('-', resultAllInOneSubdirectoryLength) : fileName.Split('.')[0][^resultAllInOneSubdirectoryLength..];
|
||||
string combined;
|
||||
byte @enum = GetEnum(filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
||||
string check = fileName.Length < resultAllInOneSubdirectoryLength ?
|
||||
new('-', resultAllInOneSubdirectoryLength) :
|
||||
fileName.Split('.')[0][^resultAllInOneSubdirectoryLength..];
|
||||
if (check.Any(l => !char.IsNumber(l)))
|
||||
{
|
||||
result = new('-', resultAllInOneSubdirectoryLength);
|
||||
combined = $"{@enum}{new('-', resultAllInOneSubdirectoryLength)}";
|
||||
converted = int.Parse($"1{new string('0', resultAllInOneSubdirectoryLength)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = check;
|
||||
combined = $"{@enum}{check}";
|
||||
converted = int.Parse(check);
|
||||
}
|
||||
return (result, converted);
|
||||
result = new(combined, @enum, converted);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static (string, int) GetDirectoryNameAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath)
|
||||
internal static CombinedEnumAndIndex GetCombinedEnumAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath)
|
||||
{
|
||||
int converted;
|
||||
string result;
|
||||
CombinedEnumAndIndex result;
|
||||
if (filePath.Id is not null)
|
||||
(result, converted) = GetDirectoryNameAndIndex(propertyConfiguration.ResultAllInOneSubdirectoryLength, filePath.Id.Value.ToString());
|
||||
result = GetCombinedEnumAndIndex(propertyConfiguration.ResultAllInOneSubdirectoryLength, filePath, filePath.Id.Value.ToString());
|
||||
else
|
||||
(result, converted) = GetDirectoryNameAndIndex(propertyConfiguration.ResultAllInOneSubdirectoryLength, filePath.FileNameFirstSegment);
|
||||
return (result, converted);
|
||||
result = GetCombinedEnumAndIndex(propertyConfiguration.ResultAllInOneSubdirectoryLength, filePath, filePath.FileNameFirstSegment);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static ReadOnlyDictionary<string, ReadOnlyCollection<string>> GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups)
|
||||
private static byte[] GetBytes() =>
|
||||
[
|
||||
11,
|
||||
15,
|
||||
19,
|
||||
51,
|
||||
55,
|
||||
59,
|
||||
91,
|
||||
95,
|
||||
99
|
||||
];
|
||||
|
||||
private static ReadOnlyDictionary<byte, ReadOnlyCollection<string>> Convert(Dictionary<byte, List<string>> keyValuePairs)
|
||||
{
|
||||
Dictionary<string, ReadOnlyCollection<string>> results = [];
|
||||
int converted = int.Parse($"1{new string('0', propertyConfiguration.ResultAllInOneSubdirectoryLength)}");
|
||||
Dictionary<byte, ReadOnlyCollection<string>> results = [];
|
||||
foreach (KeyValuePair<byte, List<string>> keyValuePair in keyValuePairs)
|
||||
results.Add(keyValuePair.Key, new(keyValuePair.Value));
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static ReadOnlyDictionary<byte, ReadOnlyCollection<string>> Convert(List<CombinedEnumAndIndex> collection)
|
||||
{
|
||||
Dictionary<byte, List<string>> results = [];
|
||||
List<string>? c;
|
||||
foreach (CombinedEnumAndIndex cei in collection)
|
||||
{
|
||||
if (!results.TryGetValue(cei.Enum, out c))
|
||||
{
|
||||
results.Add(cei.Enum, []);
|
||||
if (!results.TryGetValue(cei.Enum, out c))
|
||||
throw new Exception();
|
||||
}
|
||||
c.Add(cei.Combined);
|
||||
}
|
||||
return Convert(results);
|
||||
}
|
||||
|
||||
internal static ReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> GetKeyValuePairs(IPropertyConfiguration propertyConfiguration, string? resultsFullGroupDirectory, string[]? jsonGroups)
|
||||
{
|
||||
Dictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> results = [];
|
||||
int plusOne;
|
||||
string directory;
|
||||
string checkDirectory;
|
||||
List<string> collection;
|
||||
int plusOne = converted + 1;
|
||||
CombinedEnumAndIndex cei;
|
||||
byte[] bytes = GetBytes();
|
||||
List<CombinedEnumAndIndex> collection;
|
||||
ReadOnlyDictionary<byte, ReadOnlyCollection<string>> keyValuePairs;
|
||||
int converted = int.Parse($"1{new string('0', propertyConfiguration.ResultAllInOneSubdirectoryLength)}");
|
||||
if (jsonGroups is not null)
|
||||
{
|
||||
plusOne = converted + 1;
|
||||
foreach (string jsonGroup in jsonGroups)
|
||||
{
|
||||
collection = [];
|
||||
if (resultsFullGroupDirectory is null)
|
||||
continue;
|
||||
collection = [];
|
||||
for (int i = 0; i < plusOne; i++)
|
||||
foreach (byte @enum in bytes)
|
||||
{
|
||||
if (string.IsNullOrEmpty(jsonGroup))
|
||||
for (int i = 0; i < plusOne; i++)
|
||||
{
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
if (string.IsNullOrEmpty(jsonGroup))
|
||||
{
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, $"{@enum}{new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength)}"));
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, $"{@enum}{i.ToString().PadLeft(propertyConfiguration.ResultAllInOneSubdirectoryLength, '0')}"));
|
||||
}
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, i.ToString().PadLeft(propertyConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
{
|
||||
directory = Path.Combine(resultsFullGroupDirectory, jsonGroup);
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, $"{@enum}{new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength)}"));
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, $"{@enum}{i.ToString().PadLeft(propertyConfiguration.ResultAllInOneSubdirectoryLength, '0')}"));
|
||||
}
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
cei = new(Combined: checkDirectory, Enum: @enum, Index: -1);
|
||||
collection.Add(cei);
|
||||
}
|
||||
else
|
||||
{
|
||||
directory = Path.Combine(resultsFullGroupDirectory, jsonGroup);
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, i.ToString().PadLeft(propertyConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
}
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
collection.Add(checkDirectory);
|
||||
}
|
||||
keyValuePairs = Convert(collection);
|
||||
if (!string.IsNullOrEmpty(jsonGroup))
|
||||
results.Add(jsonGroup, new(collection));
|
||||
results.Add(jsonGroup, keyValuePairs);
|
||||
else
|
||||
results.Add(propertyConfiguration.ResultAllInOne, new(collection));
|
||||
results.Add(propertyConfiguration.ResultAllInOne, keyValuePairs);
|
||||
}
|
||||
}
|
||||
return new(results);
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user