mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
A bit more logging for delete file (in recycle bin)
This commit is contained in:
parent
17d5895957
commit
60177abf51
@ -38,6 +38,7 @@ public interface IDiskProvider
|
||||
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 @@ public virtual bool FolderExists(string path, bool caseSensitive)
|
||||
return FolderExists(path);
|
||||
}
|
||||
|
||||
|
||||
public virtual bool FileExists(string path)
|
||||
{
|
||||
Ensure.That(() => path).IsValidPath();
|
||||
@ -438,5 +438,10 @@ public bool IsParent(string parent, string subfolder)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public FileAttributes GetFileAttributes(string path)
|
||||
{
|
||||
return File.GetAttributes(path);
|
||||
}
|
||||
}
|
||||
}
|
@ -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 @@ public void DeleteFile(string path)
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user