(cherry picked from commit e79dd6f8e689617b1fd9f96c639ac300669112c5)master
parent
405ae77070
commit
c7aa1bae5e
@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NzbDrone.Common.Disk;
|
||||
|
||||
public static class SpecialFolders
|
||||
{
|
||||
private static readonly HashSet<string> _specialFolders = new HashSet<string>
|
||||
{
|
||||
// Windows
|
||||
"boot",
|
||||
"bootmgr",
|
||||
"cache",
|
||||
"msocache",
|
||||
"recovery",
|
||||
"$recycle.bin",
|
||||
"recycler",
|
||||
"system volume information",
|
||||
"temporary internet files",
|
||||
"windows",
|
||||
|
||||
// OS X
|
||||
".fseventd",
|
||||
".spotlight",
|
||||
".trashes",
|
||||
".vol",
|
||||
"cachedmessages",
|
||||
"caches",
|
||||
"trash",
|
||||
|
||||
// QNAP
|
||||
".@__thumb",
|
||||
|
||||
// Synology
|
||||
"@eadir",
|
||||
"#recycle"
|
||||
};
|
||||
|
||||
public static bool IsSpecialFolder(string folder)
|
||||
{
|
||||
if (folder == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return _specialFolders.Contains(folder.ToLowerInvariant());
|
||||
}
|
||||
}
|
Loading…
Reference in new issue