Keyword to work with Amazon

This commit is contained in:
2024-02-04 09:38:40 -07:00
parent 4081a73b9d
commit 1200780eee
38 changed files with 325 additions and 287 deletions

View File

@ -35,7 +35,7 @@ internal abstract class Id
return result;
}
internal static string GetIntelligentId(Properties.IPropertyConfiguration propertyConfiguration, long id, bool ignore)
internal static string GetIntelligentId(Properties.IPropertyConfiguration propertyConfiguration, long id, bool? ignore)
{
string result;
StringBuilder stringBuilder = new();
@ -46,12 +46,12 @@ internal abstract class Id
List<char> resultAllInOneSubdirectoryChars = [];
if (id > -1)
{
key = ignore ? 8 : 9;
key = ignore is not null && ignore.Value ? 8 : 9;
value = id.ToString().PadLeft(propertyConfiguration.IntMinValueLength, '0');
}
else
{
key = ignore ? 2 : 1;
key = ignore is not null && ignore.Value ? 2 : 1;
value = id.ToString()[1..].PadLeft(propertyConfiguration.IntMinValueLength, '0');
}
for (int i = value.Length - propertyConfiguration.ResultAllInOneSubdirectoryLength - 1; i > -1; i--)
@ -62,14 +62,14 @@ internal abstract class Id
return result;
}
internal static string GetPaddedId(Properties.IPropertyConfiguration propertyConfiguration, int id, int? index)
internal static string GetPaddedId(Properties.IPropertyConfiguration propertyConfiguration, int id, bool? ignore, int? index)
{
string result;
if (propertyConfiguration.Offset < 0)
result = Guid.NewGuid().ToString();
else
{
string intelligentId = GetIntelligentId(propertyConfiguration, id, ignore: false);
string intelligentId = GetIntelligentId(propertyConfiguration, id, ignore);
int check = GetId(propertyConfiguration, intelligentId);
if (check != id)
throw new NotSupportedException();