1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-06-30 17:43:59 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Alien21
15fc9e5021
Merge 1e096e5702 into 4cbf5cfc57 2024-06-12 18:18:14 +02:00
Alien21
1e096e5702 retrigger checks 2022-07-28 19:38:22 +02:00
Alien21
e5079fc9cf first check if directory exists before check if exist some file in it :) 2022-06-13 18:53:02 +02:00
Alien21
3736be6601 add support for .rrignore file to ignore movie folder in library import 2022-06-12 19:19:14 +02:00

View File

@ -32,6 +32,8 @@ public class RootFolderService : IRootFolderService
private readonly INamingConfigService _namingConfigService;
private readonly Logger _logger;
private static readonly string IgnoreFolderFile = ".rrignore";
private static readonly HashSet<string> SpecialFolders = new HashSet<string>
{
"$recycle.bin",
@ -185,6 +187,8 @@ private List<UnmappedFolder> GetUnmappedFolders(string path, Dictionary<int, str
var setToRemove = SpecialFolders;
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);
return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList();
}