diff --git a/DownloadTask.cs b/DownloadTask.cs index 2cdf740..b6510d2 100644 --- a/DownloadTask.cs +++ b/DownloadTask.cs @@ -774,6 +774,10 @@ private async Task DuplicateFile(string filesDir, IEnumerable outputPath var parent = PathHelper.GetParent(dest); Plugin.Resilience.Execute(() => Directory.CreateDirectory(parent)); + if (!await PathHelper.WaitForDelete(dest)) { + throw new DeleteFileException(dest); + } + // ReSharper disable once AccessToModifiedClosure Plugin.Resilience.Execute(() => File.Copy(path, dest)); return;