mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
Convert type checks and null checks into pattern matching
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user