diff options
| author | Bond-009 <bond.009@outlook.com> | 2022-12-07 16:39:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 16:39:40 +0100 |
| commit | f3c57e6a0ae015dc51cf548a0380d1bed33959c2 (patch) | |
| tree | 1052ce5b7646e4fea7b20768213e89c0e38126ec /MediaBrowser.Controller/Library | |
| parent | 681be595cea8254cbac5bbb3bdc9083c4780db21 (diff) | |
| parent | 52194f56b5f07e3ae01e2fb6d121452e37d1e93f (diff) | |
Merge pull request #8511 from Bond-009/isnull
Diffstat (limited to 'MediaBrowser.Controller/Library')
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveArgs.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/NameExtensions.cs | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 91d162b41..0424399c8 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -47,7 +47,7 @@ namespace MediaBrowser.Controller.Library public LibraryOptions LibraryOptions { - get => _libraryOptions ??= Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent); + get => _libraryOptions ??= Parent is null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent); set => _libraryOptions = value; } @@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Library get { var paths = string.IsNullOrEmpty(Path) ? Array.Empty<string>() : new[] { Path }; - return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations).ToArray(); + return AdditionalLocations is null ? paths : paths.Concat(AdditionalLocations).ToArray(); } } @@ -130,13 +130,13 @@ namespace MediaBrowser.Controller.Library { var parent = Parent; - if (parent != null) + if (parent is not null) { var item = parent as T; // Just in case the user decided to nest episodes. // Not officially supported but in some cases we can handle it. - if (item == null) + if (item is null) { var parents = parent.GetParents(); foreach (var currentParent in parents) @@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.Library } } - return item != null; + return item is not null; } return false; @@ -287,14 +287,14 @@ namespace MediaBrowser.Controller.Library /// <returns><c>true</c> if the arguments are the same, <c>false</c> otherwise.</returns> protected bool Equals(ItemResolveArgs args) { - if (args != null) + if (args is not null) { - if (args.Path == null && Path == null) + if (args.Path is null && Path is null) { return true; } - return args.Path != null && BaseItem.FileSystem.AreEqual(args.Path, Path); + return args.Path is not null && BaseItem.FileSystem.AreEqual(args.Path, Path); } return false; diff --git a/MediaBrowser.Controller/Library/NameExtensions.cs b/MediaBrowser.Controller/Library/NameExtensions.cs index 9d78b8b6c..919570e89 100644 --- a/MediaBrowser.Controller/Library/NameExtensions.cs +++ b/MediaBrowser.Controller/Library/NameExtensions.cs @@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Library private static string RemoveDiacritics(string? name) { - if (name == null) + if (name is null) { return string.Empty; } |
