Facepunch.Steamworks icon indicating copy to clipboard operation
Facepunch.Steamworks copied to clipboard

SortBy not sorting UNLESS Where function is added

Open DeeCeptor opened this issue 3 years ago • 1 comments

Query q = Query.ItemsReadyToUse; q = q.WithTag("Mission"); q= q.SortByTitleAsc(); var result = await q.GetPageAsync(1);

The SortByTitleAsc isn't applied to the returned results. If a q = q.WhereUserSubscribed(); (or other Where functions) is applied to the results, the SortByTitle() IS applied. Any ideas why?

Note: none of the SortBy functions appear to work unless a Where() function is present

By the way, thanks so much for making this framework - it's super helpful and awesome!

DeeCeptor avatar Jan 13 '22 08:01 DeeCeptor

What you should use is 'RankedByXXX', here are the reason: Don't get confused by the name 'SortByXXX', these kind of query function are used as 'Query UGC associated with a user', that's why you need to use 'WhereXXX' function to specify a user. Facepunch will invoke the following SteamAPI internally: UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage );

you can check out the following source code and API here:

wojiuxuihuan avatar May 19 '23 08:05 wojiuxuihuan