Hi @pippin - I'm posting here to have more chance to catch your
attention. I'm trying to change the behavior of the "start from last
position" so that we can have our cake and eat it, i.e. have a link when
there is a "last position" *and* have a play entry as well so that when
that track is part of a playlist, it plays as well (otherwise it's not
pushed to the playlist). In other words, here is the example of my code
from YT

Code:
--------------------
    
        if (my $lastpos = $cache->get("yt:lastpos-$id")) {
                                my $position = 
Slim::Utils::DateTime::timeFormat($lastpos);
                                $position =~ s/^0+[:\.]//;
                                $item->{type} = "link";
                                $item->{items} = [ {
                                                title => cstring(undef, 
'PLUGIN_YOUTUBE_PLAY_FROM_BEGINNING'),
                                                type   => 'audio',
                                                url    => STREAM_BASE_URL . $id,
                                                #duration => 'N/A',
                                        }, {
                                                title => cstring(undef, 
'PLUGIN_YOUTUBE_PLAY_FROM_POSITION_X', $position),
                                                type   => 'audio',
                                                url    => STREAM_BASE_URL . $id 
. "&lastpos=$lastpos",
                                                #duration => 'N/A',
                                        } ];
                        } #else {
                        {       
                                $item->{on_select}      = 'play';
                                $item->{play}           = STREAM_BASE_URL . $id;
                                $item->{playall}        = 1;
                                $item->{duration}       = 'N/A',
                        }
  
--------------------

You can see that normally (when "else" applies), I would have either a
type 'link' or a 'playlist' (set before in the code) and default UI
offers a play icon at the right of the item or if there is a last pos,
you can click it to access the "stream from beginning" and "stream from
last pos". Now, if I set both options, the default LMS UI offers both a
play and the click on the link and Material offers that as well, the
link is accessible through the "more" option. And when clicking on 'play
all', all tracks are included =>that's great. 

But with iPeng and this configuration, a short-press on a track that has
both options means the whole list is played or long-press brings a menu
where I can play only that track, but the option to read from "last
position" is gone. When I don't have bot options set, a short-press
bring a menu with "from beg" and "from last pos".

Any chance to change that? Or something we could change in XMLBrowser to
ease both parties?



LMS 8.1.x on Odroid-C4 - *SqueezeAMP!*, 5xRadio, 5xBoom, 2xDuet,
1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000,
ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi,
Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3
------------------------------------------------------------------------
philippe_44's Profile: http://forums.slimdevices.com/member.php?userid=17261
View this thread: http://forums.slimdevices.com/showthread.php?t=51929

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to