From 20ac2687df08ccf1931940c2e449b800a0b39fe9 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 d92c01d00..f3333d74e 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -153,7 +153,11 @@ namespace NzbDrone.Common.Disk { 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)