Merge pull request #50 from WeihanLi/optimize-skip_exists_check

return null when file not exits

Former-commit-id: 97cb7e966b
This commit is contained in:
Malte Rosenbjerg 2020-05-01 08:21:59 +02:00 committed by GitHub
commit 666c227f3d

View file

@ -390,7 +390,7 @@ public VideoInfo Convert(ArgumentContainer arguments, bool skipExistsCheck = fal
throw new FFMpegException(FFMpegExceptionType.Conversion, "Could not process file without error");
_totalTime = TimeSpan.MinValue;
return new VideoInfo(output);
return output.Exists ? new VideoInfo(output) : null;
}
public async Task<VideoInfo> ConvertAsync(ArgumentContainer arguments, bool skipExistsCheck = false)
{
@ -401,7 +401,7 @@ public async Task<VideoInfo> ConvertAsync(ArgumentContainer arguments, bool skip
throw new FFMpegException(FFMpegExceptionType.Conversion, "Could not process file without error");
_totalTime = TimeSpan.MinValue;
return new VideoInfo(output);
return output.Exists ? new VideoInfo(output) : null;
}
private static (VideoInfo[] Input, FileInfo Output) GetInputOutput(ArgumentContainer arguments)