Jump to content

SortOrder descending


boutzo

Recommended Posts

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
Link to comment
Share on other sites

Which language are you in?

 

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

 

The right answer is SortOrder.Descending.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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...