Get Segments
This commit is contained in:
@ -18,7 +18,7 @@ internal abstract class Mapping
|
||||
int? id;
|
||||
List<Models.Face>? faces;
|
||||
int? normalizedPixelPercentage;
|
||||
(string? Id, string? NormalizedPixelPercentage, string? ExtensionLowered, bool? Check) segments = GetSegments(facesFileNameExtension, fileName);
|
||||
(string? Id, string? NormalizedPixelPercentage, string? ExtensionLowered, bool? Check) segments = GetSegments(locationDigits, facesFileNameExtension, fileName);
|
||||
if (string.IsNullOrEmpty(segments.Id) || string.IsNullOrEmpty(segments.NormalizedPixelPercentage) || string.IsNullOrEmpty(segments.ExtensionLowered) || segments.Check is null)
|
||||
{
|
||||
id = null;
|
||||
@ -45,7 +45,7 @@ internal abstract class Mapping
|
||||
return new(id, normalizedPixelPercentage, faces);
|
||||
}
|
||||
|
||||
internal static (string?, string?, string?, bool?) GetSegments(string facesFileNameExtension, string fileName)
|
||||
internal static (string?, string?, string?, bool?) GetSegments(int locationDigits, string facesFileNameExtension, string fileName)
|
||||
{
|
||||
string[] segments = fileName.Split('.');
|
||||
string? id;
|
||||
@ -63,8 +63,8 @@ internal abstract class Mapping
|
||||
{
|
||||
id = segments[0];
|
||||
extensionLowered = $".{segments[2]}";
|
||||
normalizedPixelPercentage = segments[1];
|
||||
needsFacesFileNameExtension = segments.Length == 3;
|
||||
normalizedPixelPercentage = ILocation.GetRightPadded(locationDigits, segments[1]);
|
||||
}
|
||||
return new(id, normalizedPixelPercentage, extensionLowered, needsFacesFileNameExtension);
|
||||
}
|
||||
|
Reference in New Issue
Block a user