boutzo 0 Posted February 24, 2015 Share Posted February 24, 2015 (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 February 24, 2015 by boutzo Link to comment Share on other sites More sharing options...
ebr 14960 Posted February 24, 2015 Share Posted February 24, 2015 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 More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 c# model - 3.0.5498.43094 api - 3.0.5501.2428 Link to comment Share on other sites More sharing options...
ebr 14960 Posted February 24, 2015 Share Posted February 24, 2015 That model sounds pretty old. Are you using NuGet? I'd update the packages just to be sure. Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 ok Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 what are the current builds? Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 (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 February 24, 2015 by boutzo Link to comment Share on other sites More sharing options...
ebr 14960 Posted February 24, 2015 Share Posted February 24, 2015 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; 1 Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 You beat me to it. That's exactly what I did. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now