-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[json-rpc] add 'sort' parameter to methods PVR.GetRecordings / GetCha… #19177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks.
one problem i see here. using this new param will break the functionality against v18 and lower, where it is not known. how are such things handled usually? |
I'd say, the using app must check json-RPC version before calling. |
This is strange that the call to ParseLimits is added and was not present before. This needs a tons of tests about limits or remove that call to add the feature without changing actual usage of current params that would make the scope of this PR a lot bigger. |
the call to |
Ok fine then if it's tested and not oversight |
The limits were already parsed before in HandleLimits. In fact with ParseLimits call added this is done twice now. Interestingly, the double parse will also be done for VideoLibrary and other listings. So, we thought there must be a reason for that and simply copied the existing logics for PVR. |
This is indeed strange, the sort does apply the limits and actively remove items so if it worked before there's now double removal and counts for the return would be impacted. Are you sure limits are handled the same before and after the PR? Like GetChannels with same start and limits in the middle of the list with and without sort order and returning the proper start/end/total ? I lack time but from a quick look the way videolibrary handles it differently by passing those to the underlying query and resetting the values when needed. |
current master: this pr applied: request @Tolriq you're right, nice catch |
Things are getting more and more strange. GetChannels and friends are calling HandleFileItemlist, which has a parameter void CFileItemHandler::HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const CVariant ¶meterObject, CVariant &result, int size, bool sortLimit /* = true */)
{
int start, end;
HandleLimits(parameterObject, result, size, start, end);
if (sortLimit)
Sort(items, parameterObject); Seems, that it sorts the list, if the respective paramter is set to true. Question is whether this PR is actually needed as it seems as both sort and limits support should already work?! Is there just a bug we need to fix to get it work? |
In all cases there's need for a PR to expose the fields to the schema. As a reminded for JSON:
|
yes could be this is the wrong approach, channel list on my remote is sorted but no idea if the app does that or the request returns correctly, i'll dig into there. |
Yep. And maybe this is all what is currently missing. No code change needed. |
Just did a quick test and applied only the methods.json changes (which add the sort parameter to the methods) of the PR to my personal build, none of the code changes ... and it works. :-) |
nice, thanks for the test. everybody agrees with that? |
…nnels / GetTimers
The schema changes are ok for sure. |
jenkins build this please |
…nnels / GetTimers
Description
adds the ability to order the result sets for the named json-rpc methods. i.e. remote control apps no longer need to do sorting on their own. they can adjust their requests.
refs:
xbmc/Official-Kodi-Remote-iOS#134
https://forum.kodi.tv/showthread.php?tid=360315
no problem if postponed as this is only an improvement
Motivation and Context
Official iOS Remote returns an unordered list of recordings
How Has This Been Tested?
returns recordings in the desired order.
This is the shortened request that iOS remote sends out, extended with the new parameter.
retrieval via Official iOS Remote (AppStore and Beta) is working like before.
Types of change
Checklist:
fyi @wutschel