Jump to content

Get all root items


Recommended Posts

Posted

Hey,

I would like to get the root folders. So "Movies", "TV Shows", "Collections", "Playlists" etc. 

I can do that with this code.

Folder root = _libraryManager.GetUserRootFolder();
BaseItem[] rootItems = root.GetChildren(new InternalItemsQuery{});

A couple of items don't show up with this method, "Live TV" and "Trailers" for example (if  you have those installed).

I can see those items in root._cachedChildren, I can get them with reflection but wondering if there is an elegant way? 

Thanks!

Posted

Hi, try passing the user into the InternalItemsQuery constructor.

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...