RenameUrl
This commit is contained in:
@ -108,6 +108,24 @@ public class Rename : IRename
|
||||
|
||||
#pragma warning restore CA1416
|
||||
|
||||
private static void RenameUrl(FilePath filePath)
|
||||
{
|
||||
string[] lines = File.ReadAllLines(filePath.FullName);
|
||||
if (lines.Length == 1)
|
||||
{
|
||||
FileHolder fileHolder = new(lines[0]);
|
||||
if (fileHolder.Exists)
|
||||
{
|
||||
string checkFile;
|
||||
checkFile = IId.GetIgnoreFullPath(filePath, fileHolder);
|
||||
if (lines[0] == checkFile || lines[0].Length != checkFile.Length)
|
||||
throw new NotSupportedException();
|
||||
File.Move(lines[0], checkFile);
|
||||
}
|
||||
File.Delete(filePath.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetExifDirectoryCollection(IRename rename, RenameConfiguration renameConfiguration, List<(string, FileInfo, ExifDirectory)> exifDirectories, IEnumerable<string> files, A_Metadata metadata)
|
||||
{
|
||||
int index = -1;
|
||||
@ -124,6 +142,11 @@ public class Rename : IRename
|
||||
rename.Tick();
|
||||
fileHolder = new(file);
|
||||
filePath = FilePath.Get(renameConfiguration.MetadataConfiguration, fileHolder, index);
|
||||
if (filePath.ExtensionLowered == ".url" && filePath.Id is not null)
|
||||
{
|
||||
RenameUrl(filePath);
|
||||
continue;
|
||||
}
|
||||
if (renameConfiguration.SkipIdFiles && filePath.Id is not null && (filePath.IsIntelligentIdFormat || filePath.SortOrder is not null))
|
||||
continue;
|
||||
(ffmpegFiles, ffmpegFilePath) = rename.ConvertAndGetFfmpegFiles(renameConfiguration, filePath);
|
||||
|
Reference in New Issue
Block a user