From 9ed0f9eee83ed1ec0d969de43574c4d50af02105 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 31 Aug 2019 21:35:01 +0200 Subject: [PATCH] Fixed DownloadFile when file already exists --- src/NzbDrone.Common/Http/HttpClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index 5ddfa9f60..99327ee76 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -249,6 +249,10 @@ namespace NzbDrone.Common.Http var response = Get(request); } stopWatch.Stop(); + if (File.Exists(fileName)) + { + File.Delete(fileName); + } File.Move(fileNamePart, fileName); _logger.Debug("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds); }