From 5fc63ecb3fc1a3609231a1b8348920640c9b5cba Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 14 Jun 2024 20:22:43 +0300 Subject: [PATCH] New: Ignore inaccessible folders when getting folders (cherry picked from commit a30e9da7672a202cb9e9188cf106afc34a5d0361) --- src/NzbDrone.Common/Disk/DiskProviderBase.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index 61e80f97c..20a6607ac 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -153,7 +153,11 @@ public IEnumerable GetDirectories(string path) { Ensure.That(path, () => path).IsValidPath(PathValidationType.CurrentOs); - return Directory.EnumerateDirectories(path); + return Directory.EnumerateDirectories(path, "*", new EnumerationOptions + { + AttributesToSkip = FileAttributes.System, + IgnoreInaccessible = true + }); } public IEnumerable GetFiles(string path, bool recursive)