Jump to content

Minor Api Changes


Recommended Posts

There's a number of small changes that you all may or may not have to react to. They are designed to empower you guys and give you more flexibility.

 

ItemListHandler - The recursiveChildren api method is gone, and instead there is now a Recursive option that applies to every type of list that you can get back. (children, recently added items, etc). It is false by default so until you add the param you may notice some of your lists coming back empty.

 

Boolean params in the api - As an fyi, with the Recursive option, as well as all other boolean params, you can now use 1/0 or true/false, case in-sensitive. They will accept either.

 

IBN Handlers - get lists of Genres, People, Studios, Years. These have all been extended with the same paging api and Recursive option as the item list handler. They now return an IbnItemsResult that has the items you asked for as well as the total record count.

 

C# ApiClient - The GetItemsWithYear, Person, Genre, Studio methods have had a slight order change to their params. UserId is now first, so that all params after can be named nullables.

Link to post
Share on other sites

Fyi, the javascript ApiClient is now completely up to date with the entire api, so some of you may have interest in seeing what that looks like.

Link to post
Share on other sites

There are a few more changes to the item list handler, in preparation for adding searching capabilities.

 

- Most of the listType options have been removed, and now there is only localtrailers and specialfeatures (omit the param to just get children).

 

The other list types that used to be there have been replaced by the following:

 

- The filter param has been renamed to filters, and is a comma delimited list of filters to apply. This is based on the server-side enum ItemFilter, and now has quite a few choices:

 

HasPrimaryImageOrBackdrop,

HasPrimaryImage,

HasBackdrop,

IsFolder,

IsNotFolder,

IsUnplayed,

IsPlayed,

IsFavorite,

IsRecentlyAdded,

IsResumable,

IsRecentlyPlayed

 

On top of this, you can also filter using the following query string params:

 

- studio

- year

- genre

 

- person (person name)

- personType - This is optional, and only applicable when using the person filter.

 

Just to clarify on person, if you want all titles with Will Smith, you would just use person. If you want all titles directed by Will Smith, you would use both person and personType.

 

So basically now, instead of getting a fixed list of items based on one filter, you can combine as many filters as you want.

Link to post
Share on other sites

Scott - On the .net side, GetItemsAsync now accepts an ItemQuery object. This has all the properties you need.

 

For example, to get recently added items, you might do the following:

 

var query = new ItemQuery

{

Filters = new[] { ItemFilter.IsRecentlyAdded },

UserId = App.Instance.CurrentUser.Id,

Limit = 10,

SortBy = ItemSortBy.DateCreated,

SortOrder = SortOrder.Descending,

Recursive = true

};

 

var result = await App.Instance.ApiClient.GetItemsAsync(query);

Link to post
Share on other sites

If you just want children of a folder, you might do this:

 

var query = new ItemQuery

{

ParentId = Folder.Id,

 

UserId = App.Instance.CurrentUser.Id

};

 

Children = await App.Instance.ApiClient.GetItemsAsync(query);

Link to post
Share on other sites

Also BaseItemPerson.Overview has been renamed to Role, since that's the information it was holding and I don't want to cause confusion with the Person's overview (bio), which might be added later.

 

This class is used in the People property of DtoBaseItem.

Link to post
Share on other sites
Redshirt
Also BaseItemPerson.Overview has been renamed to Role, since that's the information it was holding and I don't want to cause confusion with the Person's overview (bio), which might be added later.

 

This class is used in the People property of DtoBaseItem.

 

I was really hoping actor bio was going to be more than a 'might'.

Link to post
Share on other sites
Also BaseItemPerson.Overview has been renamed to Role, since that's the information it was holding and I don't want to cause confusion with the Person's overview (bio), which might be added later.

 

This class is used in the People property of DtoBaseItem.

 

I was really hoping actor bio was going to be more than a 'might'.

 

 

It's already there in the back-end. Just give Luke time to get it in the API for these calls.

 

If you use the standard indexing the returned index of people will contain bio information in the Overview of those index folders.

Link to post
Share on other sites

I've extended the genre, year and studio filters to be plural (comma-delimited).

 

Based on this screenshot of plex web client (which they claim is their most powerful client), I think we should have no problems matching or surpassing them in terms of item query/look-up capabilities.

 

http://elan.plexapp.com/files/2012/08/P ... ient-2.jpg

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