Jump to content

Breaking Api Changes


Recommended Posts

There are three breaking changes:

 

I have removed the Children property from DtoBaseItem so you'll now have to make a separate call to get the children.

 

Further, the following properties have also been removed:

 

SeriesInfo

SeasonInfo

EpisodeInfo

 

The properties they used to contain are all now directly on DtoBaseItem (AirDays, Status, SeriesName, etc).

 

Finally, fulfilling Scott's request, I have made the list of fields coming back configurable, so you can basically design your own DtoBaseItem.

 

There are base fields you will always get. The configurable ones will only be supplied if you ask for them using the "fields" query string param, which is a comma delimited list of the ItemFields enum.

 

Try to only get back what you need for each given screen. Some of these will help reduce payload size, others will save the server from having to traverse the library or calculate statistics.

 

All of the methods to get lists of items have been updated, and, as usual, ApiClient is fully up to date so please check it out. Let me know if you have issues.

Link to post
Share on other sites
Redshirt

If I understand the changes correctly. The two api call is also necessary to get the root children. If that's the case, can we get each users root guid returned in the GetAllUsersAsync. That way we're saving an api call.

Link to post
Share on other sites

No, currently DtoUser does not return any information about the user's root folder. But you can get the root folder using

 

item?userId=...

 

and the root folder children using the normal get children call.

 

But the root (as well as all folders), has all of the "special counts"...

 

ChildCount

RecursiveItemCount

RecentlyAddedItemCount

etc (there are several more).

 

So you can check those and save yourself some calls if any are zero. I should probably rename ChildCount to ItemCount to make it consistent with the others.

Link to post
Share on other sites
Redshirt

I don't think you understand that I was making a request. Not asking if it currently did that.

 

Right now I perceive the logical api request order to be

 

ServerConfig

 

User or AllUsers (depending on server config)

 

GetItem (which gives the root guid)

 

GetChildren (to discover root folders)

 

 

I'm proposing you add just the root guid to the returned info for AllUsers (or User). That would eliminate 1 of the 4 api calls during client boot.

Link to post
Share on other sites

Oh I see. You can accomplish the same thing now just by calling GetChildren.

 

Pass in userId but omit id and that will give you the root. Then you can skip the call to get the root item if you wish.

Link to post
Share on other sites
Redshirt

Excellent. Sorted VF's now... It pays to ask questions when you don't know what your doing.

Link to post
Share on other sites
Redshirt

just fyi, SeriesId isn't being provided by the api for Recently Added, Recently Watched, Recently Unwatched.

 

It is provided by the api on GetItemAsync though.

Link to post
Share on other sites
ScottIsAFool

SeriesId is being returned for me when I include SeriesInfo in the field list, it's how I'm grouping together episodes on the main page in my apps.

Link to post
Share on other sites
ScottIsAFool

Eg, this url http://192.168.0.2:8096/mediabrowser/ap ... ateCreated gives me:

 

{
Name: "Run"
Id: "a86f582fb0f6f0b9ec172cc7c1e97712"
DateCreated: "2012-10-22T08:02:00.0000000Z"
PremiereDate: "2012-10-20T23:00:00.0000000Z"
CommunityRating: 8.2
RunTimeTicks: 32333440000
AspectRatio: "16:9"
ProductionYear: 2012
IndexNumber: 4
ParentIndexNumber: 7
HasBanner: false
HasArt: false
HasLogo: false
HasThumb: false
HasPrimaryImage: true
BackdropCount: 0
IsFolder: false
Type: "Episode"
ParentBackdropItemId: "7e4da231a865691a32a0798af7c1f037"
ParentBackdropCount: 1
IsNew: true
SeriesName: "Dexter"
SeriesId: "d5db9756e8af370e6333fc47155acca6"
}

Link to post
Share on other sites
Redshirt
SeriesId is being returned for me when I include SeriesInfo in the field list, it's how I'm grouping together episodes on the main page in my apps.

 

Oh that's cool. I missunderstood the intention of the whole field list thing. I thought it was purely a way to streamline the json.

Link to post
Share on other sites
ScottIsAFool

It is, it means you only need to get what you actually need. So if you're on a page that doesn't require a film's overview to be displayed, why download 100s of essays that people have written as an "overview".

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