Avoid making ".old" folders for each new img seq chunk

This commit is contained in:
n00mkrad
2021-08-31 00:47:06 +02:00
parent 024c723fd2
commit df769804f1
2 changed files with 10 additions and 7 deletions

View File

@@ -221,7 +221,7 @@ namespace Flowframes.Main
await Loop(outPath, await GetLoopTimes());
}
public static async Task EncodeChunk(string outPath, string interpDir, I.OutMode mode, int firstFrameNum, int framesAmount)
public static async Task EncodeChunk(string outPath, string interpDir, int chunkNo, I.OutMode mode, int firstFrameNum, int framesAmount)
{
string framesFileFull = Path.Combine(I.current.tempFolder, Paths.GetFrameOrderFilename(I.current.interpFactor));
string framesFileChunk = Path.Combine(I.current.tempFolder, Paths.GetFrameOrderFilenameChunk(firstFrameNum, firstFrameNum + framesAmount));
@@ -249,6 +249,9 @@ namespace Flowframes.Main
string outputFolderPath = Path.Combine(I.current.outPath, await IoUtils.GetCurrentExportFilename(false, false));
int startNumber = IoUtils.GetAmountOfFiles(outputFolderPath, false) + 1;
if(chunkNo == 1) // Only check for existing folder on first chunk, otherwise each chunk makes a new folder
IoUtils.RenameExistingFolder(outputFolderPath);
if (desiredFormat.ToUpper() == availableFormat.ToUpper()) // Move if frames are already in the desired format
await CopyOutputFrames(interpDir, framesFileChunk, outputFolderPath, fpsLimit);
else // Encode if frames are not in desired format