-
Notifications
You must be signed in to change notification settings - Fork 243
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
Issue/#219 #236
Issue/#219 #236
Conversation
Lot of changes... I wish you would have run this by me before, because i don't think that introducing So, let's take it step by step:
|
On Thu, Apr 28, 2016 at 8:30 PM, Synced Synapse notifications@github.com
So, let's take it step by step:
|
Ok, if you need some opinions or have any doubts post them here. |
Using your suggestions I refactored the code. See (btw I'll squash the commits into a single commit when we have something that can be merged) |
I can't comment on the diff, so i'll comment here. Hopefully it will be clear from context what i'm commenting on.
Logic on |
I'm not sure about putting |
@@ -85,7 +85,7 @@ public String resultFromJson(ObjectNode jsonObject) throws ApiException { | |||
/** | |||
* Retrieve all artists | |||
*/ | |||
public static class GetArtists extends ApiListMethod<List<AudioType.DetailsArtist>> { | |||
public static class GetArtists extends ApiMethod<ApiList<List<AudioType.DetailsArtist>>> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Please check the latest line comments. |
I merged the songs PR first, so now this doesn't merge cleanly. Can you check it. |
And by the way, #219 isn't needed anymore, right? |
Using Kodi's JSON RPC, Kodi may return less items than requested, even if there are more items available. The old method of determining if more items are available by checking if the amount of items returned equals the amount requested does not work in these cases. Therefore, we now use the returned List.LimitsReturned to determine if there are more items available. If List.LimitsReturned.end equals List.LimitesReturned.total we assume we retrieved all items.
Fixed and squashed. Indeed #219 can be closed. |
This PR includes PR #237. You probably want to review and merge that first.
This should fix issue #219 for music items. It should be implemented for other media items as well. But I want to show/discuss my proposed solution first.
The problem with the current way of determining if there are more items available on Kodi, is that it uses the size of the list of returned elements. When requesting media items from Kodi through JSON RPCs the
start
andend
index are given for some media. To determine if there are more items available on Kodi, the size of the returned list is used (which should equalend - start
). If Kodi returns less items than the requested size, it is assumed that all items have been retrieved.I noticed that with Jarvis, Kodi may return a list smaller than
end - start
. This will make Kore stop recursing and thus only retrieve a small part of the available items.Fortunately, Kodi returns the limit with the actual returned
start
andend
indices. My solution uses this, to determine if we should recurse and get more items. I have tested my solution with Isengard and Jarvis and AFAICT it works.(I'm thinking of adding a unit test for this in the future)