Enum change to last character
This commit is contained in:
parent
130e3b6528
commit
3f7affceef
@ -1102,7 +1102,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
||||
IDlibDotNet dlibDotNet = this;
|
||||
string filesCollectionRootDirectory = _Configuration.PropertyConfiguration.RootDirectory;
|
||||
(string cResultsFullGroupDirectory, _, _, _) = dlibDotNet.GetResultsFullGroupDirectories(outputResolution);
|
||||
IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups = Shared.Models.Stateless.Methods.IPath.GetKeyValuePairs(_Configuration.PropertyConfiguration, cResultsFullGroupDirectory, [_Configuration.PropertyConfiguration.ResultContent, _Configuration.PropertyConfiguration.ResultContentCollection]);
|
||||
IReadOnlyDictionary<string, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> fileGroups = Shared.Models.Stateless.Methods.IPath.GetKeyValuePairs(_Configuration.PropertyConfiguration, cResultsFullGroupDirectory, [_Configuration.PropertyConfiguration.ResultContent]);
|
||||
ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection = IDirectory.GetFilePathCollections(_Configuration.PropertyConfiguration, directorySearchFilter, fileSearchFilter, filesCollectionRootDirectory, useCeilingAverage: false);
|
||||
int count = filePathsCollection.Select(l => l.Count).Sum();
|
||||
bool filesCollectionCountIsOne = IsFilesCollectionCountIsOne(filePathsCollection);
|
||||
|
@ -58,15 +58,25 @@ internal abstract class XPath
|
||||
}
|
||||
}
|
||||
|
||||
internal static CombinedEnumAndIndex GetCombinedEnumAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath, string fileNameFirstSegment)
|
||||
internal static CombinedEnumAndIndex GetCombinedEnumAndIndex(IPropertyConfiguration propertyConfiguration, FilePath filePath, string fileNameWithoutExtension)
|
||||
{
|
||||
CombinedEnumAndIndex result;
|
||||
byte @enum;
|
||||
int converted;
|
||||
string combined;
|
||||
byte @enum = GetEnum(filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
||||
string check = fileNameFirstSegment.Length < propertyConfiguration.ResultAllInOneSubdirectoryLength ?
|
||||
if (filePath.HasIgnoreKeyword is null || filePath.HasDateTimeOriginal is null)
|
||||
throw new NotImplementedException();
|
||||
byte missingDateTimeOriginal = IId.GetMissingDateTimeOriginal(propertyConfiguration, filePath);
|
||||
if (filePath.HasIgnoreKeyword.Value)
|
||||
@enum = IId.GetHasIgnoreKeyword(filePath);
|
||||
else if (!filePath.HasDateTimeOriginal.Value)
|
||||
@enum = missingDateTimeOriginal;
|
||||
else
|
||||
@enum = IId.GetHasDateTimeOriginal(propertyConfiguration, filePath);
|
||||
string fileNameBeforeFirst = fileNameWithoutExtension.Split('.')[0];
|
||||
string check = fileNameBeforeFirst.Length < propertyConfiguration.ResultAllInOneSubdirectoryLength ?
|
||||
new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength) :
|
||||
fileNameFirstSegment.Split('.')[0][^propertyConfiguration.ResultAllInOneSubdirectoryLength..];
|
||||
fileNameBeforeFirst[^propertyConfiguration.ResultAllInOneSubdirectoryLength..];
|
||||
if (check.Any(l => !char.IsNumber(l)))
|
||||
{
|
||||
combined = $"{@enum}{new('-', propertyConfiguration.ResultAllInOneSubdirectoryLength)}";
|
||||
@ -81,6 +91,9 @@ internal abstract class XPath
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static byte GetEnum(FilePath filePath) =>
|
||||
GetEnum(filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
||||
|
||||
private static byte GetEnum(bool? ik, bool? dto)
|
||||
{
|
||||
byte result;
|
||||
@ -107,9 +120,6 @@ internal abstract class XPath
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static byte GetEnum(FilePath filePath) =>
|
||||
GetEnum(filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
||||
|
||||
internal static List<string> GetDirectories(string directory)
|
||||
{
|
||||
List<string> results = [];
|
||||
@ -401,15 +411,15 @@ internal abstract class XPath
|
||||
|
||||
private static byte[] GetBytes() =>
|
||||
[
|
||||
11,
|
||||
15,
|
||||
19,
|
||||
51,
|
||||
55,
|
||||
59,
|
||||
91,
|
||||
95,
|
||||
99
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
];
|
||||
|
||||
private static ReadOnlyDictionary<byte, ReadOnlyCollection<string>> Convert(Dictionary<byte, List<string>> keyValuePairs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user