Merge pull request #2772 from barronpm/codecleanup

MediaBrowser.Api code cleanup
This commit is contained in:
Bond-009
2020-04-11 19:30:23 +02:00
committed by GitHub
31 changed files with 456 additions and 742 deletions

View File

@@ -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;