> And here are a few lines which would tidy up the category list (order
> alphabetically, get rid of duplicates - to be applied around line 295 in
> Plugin.pm):
> 
> > 
Code:
--------------------
  >   >                                         my %seen;
  >                                     $menu = [ 
  >                                             sort { 
  >                                                     uc($a->{name}) cmp 
uc($b->{name}) 
  >                                             } grep { 
  >                                                     
!$seen{$_->{passthrough}->[2]}++ 
  >                                             } @$menu
  >                                     ];
  > 
--------------------
> > 
> 
> It does the de-duplication based on the url snippet (which is stored
> as the third passthrough parameter). I don't know whether this is
> working as expected in cases other than the category search. Maybe it
> should be moved to the categories parser instead.

Thanks Michael - I think there is a problem that is linked to the
question I asked in developer section if I sort the menu:

1- At the toplevel, LMS makes a 1st query for 20 items, index 0
2- I grab a YouTube search for 50 items (I have forced paging to deal
with item 5-)
3- I fill the $menu structure with up to 50 items where for each of them
{url}, {type} and {passtrhough} are set
4- User selects an item, say 10th, 
5- LMS sends again the same toplevel query search and asks for only 1
item, index 9 - huh ?
6- My previous menu context is then lost *and* in YouTube API v3, there
is *no* direct indexing of items, so all can do is grab again (with
cache soon, thank you) the same YouTube search and return only one menu
item that is the 10th element.
7- Then, and only then, LMS executes what has been set in the
one-item-menu context using {url} and {passtrhough}

So if I re-order menu items, I'm stuck, I think as the menu index does
not match anymore the youtube search index and my stop criteria that are
based on such matching are wrong. I'm not saying this is impossible, but
all this paging thing is done. That was different in API v2 as you could
do direct indexing as search result and ask for item n°1 N directly 

What would be great is that LMS would simply execute what has been set
in 10th menu item context and do not do steps 5 (and force me to do 6)



LMS 7.7.2 - 5 radio, 3 Boom, 4 Duet, 1 Touch, 1 SB2. Sonos 2xPLAY:1,
PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBMC, Foobar2000, XBoxOne
(sort of)
------------------------------------------------------------------------
philippe_44's Profile: http://forums.slimdevices.com/member.php?userid=17261
View this thread: http://forums.slimdevices.com/showthread.php?t=87731

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to