Jump to content

API Documentation


Recommended Posts

ShaneP

Hi all, is there any documentation around MediaBrowser API (C#), more so, around Collections,  what I would like to know is:

  • Creating/Deleting Collections.
  • Adding/Removing Items.

 

Currently I am in the context of of Folder (Collection) which I get by

	public Folder FindCollection(User user, string collectionName)
        {
            return _libraryManager.GetItemsResult(new InternalItemsQuery
            {
                Name = collectionName,
                IncludeItemTypes = new[] { "collections", "Boxset" },
                User = user ////try using the user with policy.IsAdministator for testing               
            }).Items.OfType<Folder>().FirstOrDefault();
        }

Which gives me reference to the Collection, is this the correct way, or should I be casting to another type?

Link to post
Share on other sites
ebr

Hi.  The API is documented automatically.  See the link at the bottom of your dashboard.

Link to post
Share on other sites
ShaneP
Just now, ebr said:

Hi.  The API is documented automatically.  See the link at the bottom of your dashboard.

Thanks Ebr, but unless I misread it, that seemed to be the docs for the rest api. But all good I eventually figured it out :) 

Link to post
Share on other sites
ebr

Oh, sorry, you are talking about creating a plug-in.  I read too fast.  The public plug-ins are the best source of examples there.  Thanks.

  • Thanks 1
Link to post
Share on other sites
Luke

To answer the question, you can make use of MediaBrowser.Controller.Collections.ICollectionManager to manipulate collections.

Link to post
Share on other sites

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...