From 3736be6601365bc282bb88a0df3a88a6cd801959 Mon Sep 17 00:00:00 2001 From: Alien21 Date: Sun, 12 Jun 2022 19:19:14 +0200 Subject: [PATCH] add support for .rrignore file to ignore movie folder in library import --- src/NzbDrone.Core/RootFolders/RootFolderService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index c7bf54edf..a48466b9c 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -30,6 +30,8 @@ public class RootFolderService : IRootFolderService private readonly IConfigService _configService; private readonly Logger _logger; + private static readonly string IgnoreFolderFile = ".rrignore"; + private static readonly HashSet SpecialFolders = new HashSet { "$recycle.bin", @@ -160,6 +162,8 @@ private List GetUnmappedFolders(string path, Dictionary 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); return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList(); }