aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ItemsService.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-04-05 12:07:43 -0400
committerPatrick Barron <barronpm@gmail.com>2020-04-05 12:07:43 -0400
commit5966ee6d87cf4abbe6cf327286788e7e03fe0592 (patch)
treeadec5ad43f5a65616701039fdb2b2de89613cf54 /MediaBrowser.Api/UserLibrary/ItemsService.cs
parent29539174a3de47c151cc7c7fd192100e6fbe48d7 (diff)
Convert type checks and null checks into pattern matching
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ItemsService.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index c7b505171..5e6cad787 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -199,14 +199,12 @@ namespace MediaBrowser.Api.UserLibrary
item = _libraryManager.GetUserRootFolder();
}
- Folder folder = item as Folder;
- if (folder == null)
+ if (!(item is Folder folder))
{
folder = _libraryManager.GetUserRootFolder();
}
- var hasCollectionType = folder as IHasCollectionType;
- if (hasCollectionType != null
+ if (folder is IHasCollectionType hasCollectionType
&& string.Equals(hasCollectionType.CollectionType, CollectionType.Playlists, StringComparison.OrdinalIgnoreCase))
{
request.Recursive = true;