From 60177abf51e09d6a2455dd372ffac5ed6a951fb4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 30 Jul 2013 02:09:48 +0200 Subject: [PATCH] A bit more logging for delete file (in recycle bin) --- NzbDrone.Common/DiskProvider.cs | 7 ++++++- NzbDrone.Core/MediaFiles/RecycleBinProvider.cs | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Common/DiskProvider.cs b/NzbDrone.Common/DiskProvider.cs index 1e9e3f69d..93658190d 100644 --- a/NzbDrone.Common/DiskProvider.cs +++ b/NzbDrone.Common/DiskProvider.cs @@ -38,6 +38,7 @@ namespace NzbDrone.Common string GetPathRoot(string path); void SetPermissions(string filename, string account, FileSystemRights Rights, AccessControlType ControlType); bool IsParent(string parentfolder, string subfolder); + FileAttributes GetFileAttributes(string path); } public class DiskProvider : IDiskProvider @@ -112,7 +113,6 @@ namespace NzbDrone.Common return FolderExists(path); } - public virtual bool FileExists(string path) { Ensure.That(() => path).IsValidPath(); @@ -438,5 +438,10 @@ namespace NzbDrone.Common return false; } + + public FileAttributes GetFileAttributes(string path) + { + return File.GetAttributes(path); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index dc946bed9..12d354a11 100644 --- a/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -2,6 +2,7 @@ using System.IO; using NLog; using NzbDrone.Common; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Messaging; using NzbDrone.Core.Configuration; using NzbDrone.Core.MediaFiles.Commands; @@ -68,6 +69,12 @@ namespace NzbDrone.Core.MediaFiles if (String.IsNullOrWhiteSpace(recyclingBin)) { logger.Info("Recycling Bin has not been configured, deleting permanently."); + + if (!OsInfo.IsLinux) + { + logger.Trace(_diskProvider.GetFileAttributes(path)); + } + _diskProvider.DeleteFile(path); logger.Trace("File has been permanently deleted: {0}", path); }