RelativePropertyCollectionFile
aMetadataCollectionDirectory Work with video FilePath.IsIgnore Removed IId IsIgnore Keywords RootAmazon SaveAmazon PhysicalFileProvider Message Bump HarFilesDirectory
This commit is contained in:
@ -35,7 +35,7 @@ internal abstract class Id
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetIntelligentId(MetadataConfiguration metadataConfiguration, long id, bool ignore)
|
||||
internal static string GetIntelligentId(MetadataConfiguration metadataConfiguration, 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(metadataConfiguration.IntMinValueLength, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
key = ignore ? 2 : 1;
|
||||
key = ignore is not null && ignore.Value ? 2 : 1;
|
||||
value = id.ToString()[1..].PadLeft(metadataConfiguration.IntMinValueLength, '0');
|
||||
}
|
||||
for (int i = value.Length - metadataConfiguration.ResultConfiguration.ResultAllInOneSubdirectoryLength - 1; i > -1; i--)
|
||||
@ -62,14 +62,19 @@ internal abstract class Id
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetPaddedId(MetadataConfiguration metadataConfiguration, int index, int id)
|
||||
internal static string GetPaddedId(MetadataConfiguration metadataConfiguration, int id, bool? ignore, int? index)
|
||||
{
|
||||
string result;
|
||||
string intelligentId = GetIntelligentId(metadataConfiguration, id, ignore: false);
|
||||
int check = GetId(metadataConfiguration, intelligentId);
|
||||
if (check != id)
|
||||
throw new NotSupportedException();
|
||||
result = $"{metadataConfiguration.Offset + index}{intelligentId}";
|
||||
if (metadataConfiguration.Offset < 0)
|
||||
result = Guid.NewGuid().ToString();
|
||||
else
|
||||
{
|
||||
string intelligentId = GetIntelligentId(metadataConfiguration, id, ignore);
|
||||
int check = GetId(metadataConfiguration, intelligentId);
|
||||
if (check != id)
|
||||
throw new NotSupportedException();
|
||||
result = index is null || metadataConfiguration.Offset == 9876543 ? intelligentId : $"{metadataConfiguration.Offset + index}{intelligentId}";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user