boutzo 0 Posted February 24, 2015 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
ebr 15670 Posted February 24, 2015 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.
boutzo 0 Posted February 24, 2015 Author Posted February 24, 2015 c# model - 3.0.5498.43094 api - 3.0.5501.2428
ebr 15670 Posted February 24, 2015 Posted February 24, 2015 That model sounds pretty old. Are you using NuGet? I'd update the packages just to be sure.
boutzo 0 Posted February 24, 2015 Author 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
ebr 15670 Posted February 24, 2015 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
boutzo 0 Posted February 24, 2015 Author Posted February 24, 2015 You beat me to it. That's exactly what I did. Thanks.
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