Jump to content

Recommended Posts

Posted

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.

Redshirt
Posted

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.

Posted

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.

Redshirt
Posted

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.

Posted

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.

Redshirt
Posted

even better :)

Redshirt
Posted

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

Redshirt
Posted

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.

ScottIsAFool
Posted

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.

ScottIsAFool
Posted

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"
}

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

ScottIsAFool
Posted

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

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