Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,525

    item lists in library browsing

    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
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  2. #2
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,525
    found it - need to add 'offset' in my response
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •