upgrade service only tries to delete existing file if it actually exists.

This commit is contained in:
kay.one 2013-07-30 22:11:54 -07:00
commit c57fb29db4
3 changed files with 51 additions and 6 deletions

View file

@ -33,14 +33,14 @@ namespace NzbDrone.Core.MediaFiles
public void DeleteFolder(string path)
{
logger.Trace("Attempting to send '{0}' to recycling bin", path);
logger.Info("Attempting to send '{0}' to recycling bin", path);
var recyclingBin = _configService.RecycleBin;
if (String.IsNullOrWhiteSpace(recyclingBin))
{
logger.Info("Recycling Bin has not been configured, deleting permanently.");
_diskProvider.DeleteFolder(path, true);
logger.Trace("Folder has been permanently deleted: {0}", path);
logger.Debug("Folder has been permanently deleted: {0}", path);
}
else
@ -57,13 +57,13 @@ namespace NzbDrone.Core.MediaFiles
_diskProvider.FileSetLastWriteTimeUtc(file, DateTime.UtcNow);
}
logger.Trace("Folder has been moved to the recycling bin: {0}", destination);
logger.Debug("Folder has been moved to the recycling bin: {0}", destination);
}
}
public void DeleteFile(string path)
{
logger.Trace("Attempting to send '{0}' to recycling bin", path);
logger.Debug("Attempting to send '{0}' to recycling bin", path);
var recyclingBin = _configService.RecycleBin;
if (String.IsNullOrWhiteSpace(recyclingBin))