All are Windows *.lnk files!

This commit is contained in:
2023-12-25 20:41:22 -07:00
parent 6909146d90
commit 1355cd0241
3 changed files with 114 additions and 30 deletions

View File

@ -87,6 +87,8 @@ internal abstract class Container
FilePath filePath = FilePath.Get(propertyConfiguration, imageFileInfo, index: null);
bool? fileSizeChanged = property is not null ? property.FileSize != filePath.Length : null;
bool isValidImageFormatExtension = propertyConfiguration.ValidImageFormatExtensions.Contains(filePath.ExtensionLowered);
if (property is not null && property.Keywords is not null && !IId.IsIgnore(filePath) && propertyConfiguration.IgnoreRulesKeyWords.Any(l => property.Keywords.Contains(l)))
throw new NotSupportedException($"Rename File! <{filePath.FileNameFirstSegment}>");
string relativePath = IPath.GetRelativePath(filePair.Path, rootDirectoryLength, forceExtensionToLower: true);
bool? lastWriteTimeChanged = property is not null ? propertyConfiguration.PropertiesChangedForProperty || property.LastWriteTime.Ticks != filePath.LastWriteTicks : null;
if (filePair.Match is not null)

View File

@ -18,6 +18,24 @@ public interface IId
static string GetPaddedId(Properties.IPropertyConfiguration propertyConfiguration, int index, int id) =>
Id.GetPaddedId(propertyConfiguration, index, id);
bool TestStatic_IsIgnore(FilePath filePath) =>
IsIgnore(filePath);
static bool IsIgnore(FilePath filePath) =>
filePath.FileNameFirstSegment[^1] is '2' or '8';
string TestStatic_GetIgnoreFullPath(FilePath filePath, Models.FileHolder fileHolder) =>
GetIgnoreFullPath(filePath, fileHolder);
static string GetIgnoreFullPath(FilePath filePath, Models.FileHolder fileHolder) =>
fileHolder.DirectoryName is null ?
throw new NotSupportedException() :
filePath.Id > -1 ?
fileHolder.NameWithoutExtension[^1] == '9' ?
Path.Combine(fileHolder.DirectoryName, $"{fileHolder.NameWithoutExtension[..^1]}8{fileHolder.ExtensionLowered}") :
throw new NotSupportedException("High") :
fileHolder.NameWithoutExtension[^1] == '1' ?
Path.Combine(fileHolder.DirectoryName, $"{fileHolder.NameWithoutExtension[..^1]}2{fileHolder.ExtensionLowered}") :
throw new NotSupportedException("Low");
bool TestStatic_NameWithoutExtensionIsIntelligentIdFormat(Properties.IPropertyConfiguration propertyConfiguration, string fileNameFirstSegment) =>
NameWithoutExtensionIsIntelligentIdFormat(propertyConfiguration, fileNameFirstSegment);
static bool NameWithoutExtensionIsIntelligentIdFormat(Properties.IPropertyConfiguration propertyConfiguration, string fileNameFirstSegment) =>