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

@@ -2462,19 +2462,14 @@ namespace Emby.Server.Implementations.Library
public BaseItem GetParentItem(string parentId, Guid? userId)
{
if (!string.IsNullOrEmpty(parentId))
if (string.IsNullOrEmpty(parentId))
{
return GetItemById(new Guid(parentId));
return GetParentItem((Guid?)null, userId);
}
if (userId.HasValue && userId != Guid.Empty)
{
return GetUserRootFolder();
}
return RootFolder;
return GetParentItem(new Guid(parentId), userId);
}
public BaseItem GetParentItem(Guid? parentId, Guid? userId)
{
if (parentId.HasValue)