Season breakout

DirectoryName to DirectoryFullPath
This commit is contained in:
2024-11-02 14:24:28 -07:00
parent 444e7ed71a
commit 4da353d150
23 changed files with 91 additions and 109 deletions

View File

@ -351,10 +351,10 @@ internal abstract partial class XDirectory
{
tick?.Invoke();
filePath = sortedRecords[i];
if (filePath.Name.EndsWith("len") || filePath.ExtensionLowered == ".id" || filePath.ExtensionLowered == ".lsv" || filePath.DirectoryName is null)
if (filePath.Name.EndsWith("len") || filePath.ExtensionLowered == ".id" || filePath.ExtensionLowered == ".lsv" || filePath.DirectoryFullPath is null)
continue;
(_, directoryIndex) = IPath.GetDirectoryNameAndIndex(propertyConfiguration, filePath);
fileDirectoryName = Path.GetFileName(filePath.DirectoryName);
fileDirectoryName = Path.GetFileName(filePath.DirectoryFullPath);
if (fileDirectoryName.Length < propertyConfiguration.ResultAllInOneSubdirectoryLength + 3 || !filePath.Name.StartsWith(fileDirectoryName))
{
if (wrapped)
@ -367,10 +367,10 @@ internal abstract partial class XDirectory
wrapped = true;
directory = Path.Combine(directories[directoryIndex], fileDirectoryName);
}
if (ifCanUseId && filePath.IsIntelligentIdFormat && filePath.Id is not null && filePath.DirectoryName is not null)
if (ifCanUseId && filePath.IsIntelligentIdFormat && filePath.Id is not null && filePath.DirectoryFullPath is not null)
{
paddedId = IId.GetPaddedId(propertyConfiguration, filePath.Id.Value, filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal, i);
paddedIdFile = Path.Combine(filePath.DirectoryName, $"{paddedId}{filePath.ExtensionLowered}");
paddedIdFile = Path.Combine(filePath.DirectoryFullPath, $"{paddedId}{filePath.ExtensionLowered}");
if (!File.Exists(paddedIdFile))
{
File.Move(filePath.FullName, paddedIdFile);
@ -392,10 +392,10 @@ internal abstract partial class XDirectory
checkFile = Path.Combine(directory, $"{intelligentId}{filePath.ExtensionLowered}");
else
{
if (filePath.DirectoryName is null)
if (filePath.DirectoryFullPath is null)
continue;
paddedId = IId.GetPaddedId(propertyConfiguration, filePath.Id.Value, filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal, i);
paddedIdFile = Path.Combine(filePath.DirectoryName, $"{paddedId}{filePath.ExtensionLowered}");
paddedIdFile = Path.Combine(filePath.DirectoryFullPath, $"{paddedId}{filePath.ExtensionLowered}");
if (File.Exists(paddedIdFile))
continue;
File.Move(filePath.FullName, paddedIdFile);
@ -406,7 +406,7 @@ internal abstract partial class XDirectory
}
if ((filePath.Id is not null && distinctIds.Contains(filePath.Id.Value)) || distinct.Contains(checkFile))
{
if (string.IsNullOrEmpty(filePath.DirectoryName))
if (string.IsNullOrEmpty(filePath.DirectoryFullPath))
continue;
if (!copyDuplicates)
continue;