There something I've never undertood well in library browsing and I had to do for the YT plugin. Say there is a topmenu that has an item with a search box". LMS calling that menu item handler with the following args
{
'search' => 'THESEARCHQUERY',
'quantity' => 50,
'wantMetadata' => 1,
'library_id' => undef,
'isWeb' => 1,
'params' => undef,
'index' => undef,
'wantIndex' => 1,
'orderBy' => undef
};
My plugin response will be a list of items and a grand total which is, say 200, but I only answer with the first 50 (it's faster than getting the whole 200). So the UI will display the 1st 50 items but show that there are 4 pages and the user can click on any of the page number 1..4. If I click on page 2, then I have the following query
{
'search' => 'THESEARCHQUERY',
'quantity' => 50,
'wantMetadata' => 1,
'library_id' => undef,
'isWeb' => 1,
'params' => undef,
'index' => '50', (would be 100 if I click on page '3')
'wantIndex' => 1,
'orderBy' => undef
};
I was expecting to answer with the next 50 items (i.e. start at offset 50), but if I do that, the UI is confused and does not display the items properly. I need to answer with the whole 100 items, the first 50 as before and then add at least another 50 (of course I could add the remaining but that's still a speed issue). Is this what's expected or do I miss something in the answer I made initially which forces LMS to expect the *whole* list everytime, although it tells me that it wants to start at index 50
{
'search' => 'THESEARCHQUERY',
'quantity' => 50,
'wantMetadata' => 1,
'library_id' => undef,
'isWeb' => 1,
'params' => undef,
'index' => undef,
'wantIndex' => 1,
'orderBy' => undef
};
My plugin response will be a list of items and a grand total which is, say 200, but I only answer with the first 50 (it's faster than getting the whole 200). So the UI will display the 1st 50 items but show that there are 4 pages and the user can click on any of the page number 1..4. If I click on page 2, then I have the following query
{
'search' => 'THESEARCHQUERY',
'quantity' => 50,
'wantMetadata' => 1,
'library_id' => undef,
'isWeb' => 1,
'params' => undef,
'index' => '50', (would be 100 if I click on page '3')
'wantIndex' => 1,
'orderBy' => undef
};
I was expecting to answer with the next 50 items (i.e. start at offset 50), but if I do that, the UI is confused and does not display the items properly. I need to answer with the whole 100 items, the first 50 as before and then add at least another 50 (of course I could add the remaining but that's still a speed issue). Is this what's expected or do I miss something in the answer I made initially which forces LMS to expect the *whole* list everytime, although it tells me that it wants to start at index 50