|
|
@ -32,6 +32,8 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
private readonly INamingConfigService _namingConfigService;
|
|
|
|
private readonly INamingConfigService _namingConfigService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly string IgnoreFolderFile = ".rrignore";
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly HashSet<string> SpecialFolders = new HashSet<string>
|
|
|
|
private static readonly HashSet<string> SpecialFolders = new HashSet<string>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"$recycle.bin",
|
|
|
|
"$recycle.bin",
|
|
|
@ -185,6 +187,8 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
var setToRemove = SpecialFolders;
|
|
|
|
var setToRemove = SpecialFolders;
|
|
|
|
results.RemoveAll(x => setToRemove.Contains(new DirectoryInfo(x.Path.ToLowerInvariant()).Name));
|
|
|
|
results.RemoveAll(x => setToRemove.Contains(new DirectoryInfo(x.Path.ToLowerInvariant()).Name));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results.RemoveAll(x => Directory.Exists(x.Path) && Directory.GetFiles(x.Path, IgnoreFolderFile).Length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Debug("{0} unmapped folders detected.", results.Count);
|
|
|
|
_logger.Debug("{0} unmapped folders detected.", results.Count);
|
|
|
|
return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList();
|
|
|
|
return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|