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

@ -10,6 +10,7 @@ public record FilePath(long CreationTicks,
string FileNameFirstSegment,
string FullName,
int? Id,
bool? IsIgnore,
bool IsIntelligentIdFormat,
long LastWriteTicks,
long Length,
@ -38,14 +39,15 @@ public record FilePath(long CreationTicks,
string fileNameFirstSegment = fileHolder.Name.Split('.')[0];
int sortOrderOnlyLengthIndex = propertyConfiguration.Offset.ToString().Length;
string fileDirectoryName = fileHolder.DirectoryName ?? throw new NullReferenceException();
bool fileNameFirstSegmentIsIntelligentIdFormat = IId.NameWithoutExtensionIsIntelligentIdFormat(propertyConfiguration, fileNameFirstSegment);
bool fileNameFirstSegmentIsPaddedIntelligentIdFormat = IId.NameWithoutExtensionIsPaddedIntelligentIdFormat(propertyConfiguration, sortOrderOnlyLengthIndex, fileNameFirstSegment);
bool fileNameFirstSegmentIsIdFormat = !fileNameFirstSegmentIsPaddedIntelligentIdFormat && !fileNameFirstSegmentIsIntelligentIdFormat && IId.NameWithoutExtensionIsIdFormat(propertyConfiguration, fileHolder);
if (!fileNameFirstSegmentIsIdFormat && !fileNameFirstSegmentIsIntelligentIdFormat && !fileNameFirstSegmentIsPaddedIntelligentIdFormat)
bool isIntelligentIdFormat = IId.NameWithoutExtensionIsIntelligentIdFormat(propertyConfiguration, fileNameFirstSegment);
bool isPaddedIntelligentIdFormat = IId.NameWithoutExtensionIsPaddedIntelligentIdFormat(propertyConfiguration, sortOrderOnlyLengthIndex, fileNameFirstSegment);
bool fileNameFirstSegmentIsIdFormat = !isPaddedIntelligentIdFormat && !isIntelligentIdFormat && IId.NameWithoutExtensionIsIdFormat(propertyConfiguration, fileHolder);
bool? isIgnore = !isIntelligentIdFormat && !isPaddedIntelligentIdFormat ? null : fileNameFirstSegment[^1] is '2' or '8';
if (!fileNameFirstSegmentIsIdFormat && !isIntelligentIdFormat && !isPaddedIntelligentIdFormat)
(id, sortOder) = (null, null);
else if (fileNameFirstSegmentIsIntelligentIdFormat)
else if (isIntelligentIdFormat)
(id, sortOder) = (IId.GetId(propertyConfiguration, fileNameFirstSegment), null);
else if (fileNameFirstSegmentIsPaddedIntelligentIdFormat)
else if (isPaddedIntelligentIdFormat)
{
if (!int.TryParse(fileNameFirstSegment[..sortOrderOnlyLengthIndex], out int absoluteValueOfSortOrder))
(id, sortOder) = (null, null);
@ -68,7 +70,8 @@ public record FilePath(long CreationTicks,
fileNameFirstSegment,
fileHolder.FullName,
id,
fileNameFirstSegmentIsIntelligentIdFormat,
isIgnore,
isIntelligentIdFormat,
fileHolder.LastWriteTime.Value.Ticks,
fileHolder.Length.Value,
fileHolder.Name,