Use GetParentItem where applicable

This commit is contained in:
crobibero
2020-12-01 16:16:17 -07:00
parent f48e47be5f
commit b5a7a74e89
4 changed files with 8 additions and 34 deletions

View File

@@ -239,14 +239,8 @@ namespace Jellyfin.Api.Controllers
parentId = null;
}
BaseItem? item = null;
var item = _libraryManager.GetParentItem(parentId, userId);
QueryResult<BaseItem> result;
if (parentId.HasValue)
{
item = _libraryManager.GetItemById(parentId.Value);
}
item ??= _libraryManager.GetUserRootFolder();
if (!(item is Folder folder))
{