Jump to content

Recommended Posts

Posted (edited)

My code is this:

 

ItemQuery iq = new ItemQuery

{

UserId = this._uid,

SortBy = new string[] { "SortName" },

SortOrder = 0,

IncludeItemTypes = new string[] { "Season" },

Limit = 100,

ParentId = ID,

Recursive = false

};

 

SortOrder = 0, means ascending and it works

 

What is the proper way to get a descending SortOrder?  If I use 1 "which I thought it would be"  throws an explicit conversion error.

SortOrder = SortOrder.Descending, also throws an explicit conversion error.

Edited by boutzo
Posted

Which language are you in?

 

You have the model and/or ApiClient libraries for that language?

 

The right answer is SortOrder.Descending.

Posted

c#

model - 3.0.5498.43094

api - 3.0.5501.2428

Posted

That model sounds pretty old.  Are you using NuGet?  I'd update the packages just to be sure.

Posted (edited)

Updated all my builds but this is the error I keep getting:

 

Cannot implicitly convert type 'System.Windows.Forms.SortOrder' to 'MediaBrowser.Model.Entities.SortOrder?'. An explicit conversion exists (are you missing a cast?

 

when typed as such

 

SortOrder = SortOrder.Descending,

 

Edited by boutzo
Posted

You are just pulling the wrong definition.  Do you really need Forms?  Does this program have a forms interface?  If not, get rid of that reference.

 

In any case, just fully-qualify the reference to what you need:

 

SortOrder = MediaBrowser.Model.Entities.SortOrder.Descending;

  • Like 1
Posted

You beat me to it.  That's exactly what I did. Thanks.

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