mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Special folders also apply to RootFolder unmapped folders
This commit is contained in:
parent
26dbafee08
commit
19906e0350
3 changed files with 22 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -11,6 +12,7 @@ namespace NzbDrone.Common
|
|||
{
|
||||
public interface IDiskProvider
|
||||
{
|
||||
HashSet<string> SpecialFolders { get; }
|
||||
DateTime GetLastFolderWrite(string path);
|
||||
DateTime GetLastFileWrite(string path);
|
||||
void EnsureFolder(string path);
|
||||
|
@ -36,14 +38,14 @@ namespace NzbDrone.Common
|
|||
void FolderSetLastWriteTimeUtc(string path, DateTime dateTime);
|
||||
bool IsFileLocked(FileInfo file);
|
||||
string GetPathRoot(string path);
|
||||
void SetPermissions(string filename, string account, FileSystemRights Rights, AccessControlType ControlType);
|
||||
void SetPermissions(string filename, string account, FileSystemRights rights, AccessControlType controlType);
|
||||
bool IsParent(string parentfolder, string subfolder);
|
||||
FileAttributes GetFileAttributes(string path);
|
||||
FileAttributes GetFileAttributes(string path);
|
||||
}
|
||||
|
||||
public class DiskProvider : IDiskProvider
|
||||
{
|
||||
enum TransferAction
|
||||
enum TransferAction
|
||||
{
|
||||
Copy,
|
||||
Move
|
||||
|
@ -58,6 +60,14 @@ namespace NzbDrone.Common
|
|||
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public HashSet<string> SpecialFolders
|
||||
{
|
||||
get
|
||||
{
|
||||
return new HashSet<string> { "$recycle.bin", "system volume information", "recycler" };
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime GetLastFolderWrite(string path)
|
||||
{
|
||||
Ensure.That(() => path).IsValidPath();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue