aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO/LibraryMonitor.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-10-13 19:08:00 +0200
committerBond_009 <bond.009@outlook.com>2022-12-07 16:43:59 +0100
commitb366dc2e6e5be2b93f2b6fcc4549a32b655c3806 (patch)
tree8f7ee8407e31e58db9aabe74bfc21936275ec45e /Emby.Server.Implementations/IO/LibraryMonitor.cs
parent93fd462b581207d937c5d4eb939b1cc96c86c1f2 (diff)
Use ArgumentException.ThrowIfNullOrEmpty
Diffstat (limited to 'Emby.Server.Implementations/IO/LibraryMonitor.cs')
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs20
1 files changed, 4 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index e88346771..4b999d40b 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -71,20 +71,14 @@ namespace Emby.Server.Implementations.IO
public void ReportFileSystemChangeBeginning(string path)
{
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException(nameof(path));
- }
+ ArgumentException.ThrowIfNullOrEmpty(path);
TemporarilyIgnore(path);
}
public async void ReportFileSystemChangeComplete(string path, bool refreshPath)
{
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException(nameof(path));
- }
+ ArgumentException.ThrowIfNullOrEmpty(path);
// This is an arbitrary amount of time, but delay it because file system writes often trigger events long after the file was actually written to.
// Seeing long delays in some situations, especially over the network, sometimes up to 45 seconds
@@ -197,10 +191,7 @@ namespace Emby.Server.Implementations.IO
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <c>null</c>.</exception>
private static bool ContainsParentFolder(IEnumerable<string> lst, string path)
{
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException(nameof(path));
- }
+ ArgumentException.ThrowIfNullOrEmpty(path);
path = path.TrimEnd(Path.DirectorySeparatorChar);
@@ -356,10 +347,7 @@ namespace Emby.Server.Implementations.IO
public void ReportFileSystemChanged(string path)
{
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException(nameof(path));
- }
+ ArgumentException.ThrowIfNullOrEmpty(path);
var monitorPath = !IgnorePatterns.ShouldIgnore(path);