Split nested conditional

This commit is contained in:
crobibero 2020-12-01 12:10:11 -07:00
parent 2055d49701
commit f48e47be5f
1 changed files with 13 additions and 5 deletions

View File

@ -71,11 +71,19 @@ namespace Jellyfin.Api.Controllers
parentItem = null;
}
var item = parentId.HasValue
? parentItem
: user == null
? _libraryManager.RootFolder
: _libraryManager.GetUserRootFolder();
BaseItem? item;
if (parentId.HasValue)
{
item = parentItem;
}
else if (user == null)
{
item = _libraryManager.RootFolder;
}
else
{
item = _libraryManager.GetUserRootFolder();
}
var query = new InternalItemsQuery
{