rechigo 293 Posted April 3, 2020 Share Posted April 3, 2020 (edited) I've tried a couple different ways, but all of them result in an Id that is not equal to that of the containing library. BaseItem.Parent BaseItem.GetTopParent() All of them give me the correct NAME of the library (movies), but the ID does not correlate to that of the Movies library returned in UserViewManager.GetUserViews TLDR: HOW can I get the the ID of the Library that the BaseItem is part of Edited April 3, 2020 by rechigo Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted April 3, 2020 Share Posted April 3, 2020 What Id of the BaseItem do you look at? There are many of them and it depends on what to do next with the Id, but i guess you want to use InternalId. Link to comment Share on other sites More sharing options...
rechigo 293 Posted April 3, 2020 Author Share Posted April 3, 2020 (edited) What Id of the BaseItem do you look at? There are many of them and it depends on what to do next with the Id, but i guess you want to use InternalId. I'm looking at the Id property (GUID) I just do not know how to get the Library ID (guid) that the base item is part of Okay, I ended up just doing it like this _userViewManager.GetUserViews( new UserViewQuery { UserId = _userManager.GetInternalId(Guid.Parse(UserId)) } ).ToList().ForEach(folder => { if(folder.GetItemIdList(new InternalItemsQuery {}).Contains(item.InternalId)) { // do whatever now that we know it is in a library the user can access } }); Edited April 4, 2020 by rechigo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now