re-organized configurations
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
using View_by_Distance.Shared.Models.Properties;
|
||||
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
internal abstract class XPath
|
||||
@ -283,12 +281,12 @@ internal abstract class XPath
|
||||
return (result, converted);
|
||||
}
|
||||
|
||||
internal static Dictionary<string, string[]> GetKeyValuePairs(IMetadataConfiguration aAConfiguration, string? resultsFullGroupDirectory, string[]? directories)
|
||||
internal static Dictionary<string, string[]> GetKeyValuePairs(ResultConfiguration resultConfiguration, string? resultsFullGroupDirectory, string[]? directories)
|
||||
{
|
||||
Dictionary<string, string[]> results = [];
|
||||
string directory;
|
||||
string checkDirectory;
|
||||
int converted = int.Parse($"1{new string('0', aAConfiguration.ResultAllInOneSubdirectoryLength)}");
|
||||
int converted = int.Parse($"1{new string('0', resultConfiguration.ResultAllInOneSubdirectoryLength)}");
|
||||
int plusOne = converted + 1;
|
||||
List<string> collection = [];
|
||||
if (directories is not null)
|
||||
@ -303,17 +301,17 @@ internal abstract class XPath
|
||||
if (string.IsNullOrEmpty(key))
|
||||
{
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, new('-', aAConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, new('-', resultConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, i.ToString().PadLeft(aAConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(resultsFullGroupDirectory, i.ToString().PadLeft(resultConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
}
|
||||
else
|
||||
{
|
||||
directory = Path.Combine(resultsFullGroupDirectory, key, aAConfiguration.ResultAllInOne);
|
||||
directory = Path.Combine(resultsFullGroupDirectory, key, resultConfiguration.ResultAllInOne);
|
||||
if (i == converted)
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, new('-', aAConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, new('-', resultConfiguration.ResultAllInOneSubdirectoryLength)));
|
||||
else
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, i.ToString().PadLeft(aAConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
checkDirectory = Path.GetFullPath(Path.Combine(directory, i.ToString().PadLeft(resultConfiguration.ResultAllInOneSubdirectoryLength, '0')));
|
||||
}
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
@ -322,7 +320,7 @@ internal abstract class XPath
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
results.Add(key, collection.ToArray());
|
||||
else
|
||||
results.Add(aAConfiguration.ResultAllInOne, collection.ToArray());
|
||||
results.Add(resultConfiguration.ResultAllInOne, collection.ToArray());
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
Reference in New Issue
Block a user