mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-02 06:07:19 +02:00
add support for .rrignore file to ignore movie folder in library import
This commit is contained in:
parent
43257f0726
commit
3736be6601
@ -30,6 +30,8 @@ public class RootFolderService : IRootFolderService
|
|||||||
private readonly IConfigService _configService;
|
private readonly IConfigService _configService;
|
||||||
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",
|
||||||
@ -160,6 +162,8 @@ private List<UnmappedFolder> GetUnmappedFolders(string path, Dictionary<int, str
|
|||||||
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.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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user