|
@@ -11,6 +11,7 @@ using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Library;
|
|
using MediaBrowser.Controller.Library;
|
|
using MediaBrowser.Controller.Plugins;
|
|
using MediaBrowser.Controller.Plugins;
|
|
using MediaBrowser.Model.IO;
|
|
using MediaBrowser.Model.IO;
|
|
|
|
+using Emby.Server.Implementations.Library;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
namespace Emby.Server.Implementations.IO
|
|
namespace Emby.Server.Implementations.IO
|
|
@@ -37,38 +38,6 @@ namespace Emby.Server.Implementations.IO
|
|
/// </summary>
|
|
/// </summary>
|
|
private readonly ConcurrentDictionary<string, string> _tempIgnoredPaths = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
private readonly ConcurrentDictionary<string, string> _tempIgnoredPaths = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// Any file name ending in any of these will be ignored by the watchers.
|
|
|
|
- /// </summary>
|
|
|
|
- private static readonly HashSet<string> _alwaysIgnoreFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
|
|
|
- {
|
|
|
|
- "small.jpg",
|
|
|
|
- "albumart.jpg",
|
|
|
|
-
|
|
|
|
- // WMC temp recording directories that will constantly be written to
|
|
|
|
- "TempRec",
|
|
|
|
- "TempSBE"
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- private static readonly string[] _alwaysIgnoreSubstrings = new string[]
|
|
|
|
- {
|
|
|
|
- // Synology
|
|
|
|
- "eaDir",
|
|
|
|
- "#recycle",
|
|
|
|
- ".wd_tv",
|
|
|
|
- ".actors"
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- private static readonly HashSet<string> _alwaysIgnoreExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
|
|
|
- {
|
|
|
|
- // thumbs.db
|
|
|
|
- ".db",
|
|
|
|
-
|
|
|
|
- // bts sync files
|
|
|
|
- ".bts",
|
|
|
|
- ".sync"
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Add the path to our temporary ignore list. Use when writing to a path within our listening scope.
|
|
/// Add the path to our temporary ignore list. Use when writing to a path within our listening scope.
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -395,12 +364,7 @@ namespace Emby.Server.Implementations.IO
|
|
throw new ArgumentNullException(nameof(path));
|
|
throw new ArgumentNullException(nameof(path));
|
|
}
|
|
}
|
|
|
|
|
|
- var filename = Path.GetFileName(path);
|
|
|
|
-
|
|
|
|
- var monitorPath = !string.IsNullOrEmpty(filename) &&
|
|
|
|
- !_alwaysIgnoreFiles.Contains(filename) &&
|
|
|
|
- !_alwaysIgnoreExtensions.Contains(Path.GetExtension(path)) &&
|
|
|
|
- _alwaysIgnoreSubstrings.All(i => path.IndexOf(i, StringComparison.OrdinalIgnoreCase) == -1);
|
|
|
|
|
|
+ var monitorPath = !IgnorePatterns.ShouldIgnore(path);
|
|
|
|
|
|
// Ignore certain files
|
|
// Ignore certain files
|
|
var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList();
|
|
var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList();
|