Bug 13462 - touch-to-play needs to style and push correctly to now playing for correct XMLBrowse items
: touch-to-play needs to style and push correctly to now playing for correct XM...
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: XML
: unspecified
: PC Other
: P1 normal (vote)
: 7.5.0
Assigned To: Michael Herger
:
Depends on:
Blocks: 13969 14026 14848
  Show dependency treegraph
 
Reported: 2009-08-18 12:15 UTC by Ben Klaas
Modified: 2010-04-08 17:25 UTC (History)
5 users (show)

See Also:
Category: Bug


Attachments
don't make playall do addall too (704 bytes, patch)
2010-01-04 09:34 UTC, Michael Herger
Details | Diff
apply playtrackalbum to menu items, not when a playlist command is sent (2.16 KB, patch)
2010-01-06 04:19 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Klaas 2009-08-18 12:15:20 UTC
steps to reproduce:

1. Pandora->Genre Stations->Some Genre->Some Station
2. notice Some Station is not styled as Touch-to-Play (touch-to-play has no right item arrow)
3. notice when selecting Some Station it does play immediately but does not properly push to the Now Playing screen

this needs auditing throughout XMLBrowseLand
Comment 1 Ben Klaas 2009-09-03 21:51:26 UTC
This is the dump of $item from a Pandora genre station. The touchToPlay sub in XMLBrowser doesn't see this as a touch-to-play item, but this begs the question: why does this item start the station playing when you select it?

 {
  items => [],
  name  => "Trip Hop",
  type  => "link",
  url   => "http://www.test.squeezenetwork.com/api/pandora/v1/opml/create?stationToken=184653528981422995",
  value => "http://www.test.squeezenetwork.com/api/pandora/v1/opml/create?stationToken=184653528981422995",
}

a quick audit of things in XMLBrowse land that I think should be touch-to-play:

Pandora Genre Stations (fail)
Pandora Saved Stations (fail)
Last.FM stations (pass)
MP3Tunes tracks (pass)
Napster tracks (fail)
Podcast Player individual podcast (pass)
RadioTime station listings (pass)
Rhapsody track listings (fail)
Slacker station listings (fail)


assigning to Andy for comment. Pass back my way after that...

failure debug-- these all did not come back true from the touchToPlay() check in XMLBrowser. Pandora saved station auto-plays, others drill in

$item dump from Pandora saved station

{
  items => [],
  name  => "The National Radio",
  play  => "pandora://12250187369256230.mp3",
  type  => "link",
  url   => "http://www.test.squeezenetwork.com/api/pandora/v1/opml/station?stationId=12250187369256230",
  value => "http://www.test.squeezenetwork.com/api/pandora/v1/opml/station?stationId=12250187369256230",
}
$item dump from napster track listing

 {
  _slim_id => 5,
  duration => 307,
  items    => [],
  name     => "This Is Goodbye by Blue Foundation from Dead People's Choice",
  play     => "napster://track:17352973.wma",
  type     => "link",
  url      => "http://www.test.squeezenetwork.com/api/napster/v1/opml/trackInfo?track=track%3A17352973&inLibrary=1",
  value    => "http://www.test.squeezenetwork.com/api/napster/v1/opml/trackInfo?track=track%3A17352973&inLibrary=1",
}
$item dump from Rhapsody Track listing

[09-09-03 23:42:20.2334] Data::Dump::dump (100) Warning: {
  _slim_id => 7,
  duration => 293,
  items    => [],
  name     => "8. Black S by Blue Foundation from Blue Foundation",
  play     => "rhapd://Tra.12419462.mp3",
  playall  => 1,
  type     => "link",
  url      => "http://www.test.squeezenetwork.com/api/rhapsody/v1/opml/metadata/getTrack?trackId=Tra.12419462&inLibrary=1",
  value    => "http://www.test.squeezenetwork.com/api/rhapsody/v1/opml/metadata/getTrack?trackId=Tra.12419462&inLibrary=1",
}

$item dump from Slacker station listing
 {
  items => [],
  name  => "'90s Alternative",
  play  => "slacker://stations/1603507/53.mp3",
  type  => "link",
  url   => "http://www.test.squeezenetwork.com/api/slacker/v1/opml/station_menu?sid=stations/1603507/53",
  value => "http://www.test.squeezenetwork.com/api/slacker/v1/opml/station_menu?sid=stations/1603507/53",
}
Comment 2 Andy Grundman 2009-09-04 05:08:14 UTC
The genre stations are tricky, because to play them you have to first copy them to your list of stations, and then play them.  So a bit of (ugly) magic happens behind the scenes when you access one, and then they automatically start playing.  I'm afraid there is no good solution to this problem.  Maybe we need yet another custom attribute...
Comment 3 Andy Grundman 2009-09-04 06:33:33 UTC
*** Bug 13685 has been marked as a duplicate of this bug. ***
Comment 4 Jim McAtee 2009-09-04 13:52:42 UTC
(In reply to comment #0)

> 3. notice when selecting Some Station it does play immediately but does not
> properly push to the Now Playing screen

I just filed bug 13854, seeing something similar from My Music > Music Folder.  Is it related or a dupe of this bug?
Comment 5 Andy Grundman 2009-09-04 18:23:24 UTC
Surely this isn't CAT2, as it's Fab4-specific right?
Comment 6 Ben Klaas 2009-09-04 19:43:47 UTC
It is not Fab4 specific. "Touch to play" for Baby = "Press Knob to Play". This is basically working perfectly to design spec for local music, but not at all on XML Browse lists. What I'm lacking is a fundamental understanding of whether we can consistently determine that yes, this a "touch/press to play" item.

The failures listed in the earlier comment failed because touchToPlay() returned undef, even though they were all items that should have been touch/press to play. I was dumping $item when the sub failed with the debug below

sub touchToPlay {
        my $item = shift;

        if ( $item->{'type'} && $item->{'type'} =~ /^(?:audio)$/ ) {
$log->error('yes, item has type and type is audio');
                return $item->{'url'} || scalar @{ $item->{outline} || [] };
        }
        elsif ( $item->{'type'} && $item->{'type'} =~ /^(?:playlist)$/ && $item->{'parser'} ) {
$log->error('yes, item has type and type is playlist and item is parser');
                return $item->{'url'};
        }
        elsif ( $item->{'enclosure'} && ( $item->{'enclosure'}->{'type'} =~ /audio/ ) ) {
$log->error('yes, item has enclosure and enclosure type is audio');
                return $item->{'enclosure'}->{'url'};
        }
        else {
$log->error('no, it is not.');
Data::Dump::dump($item);
                return undef;
        }
}
Comment 7 Andy Grundman 2009-09-04 19:44:51 UTC
Hmm, where's the design spec for what should be a touch to play item?
Comment 8 Ben Klaas 2009-09-04 19:50:49 UTC
I can't point you to a document, but the gist of it is that if its a playable item at the lowest level of a tree structure (i.e., local track, rhapsody track, individual podcast, pandora station, etc.), it should be touch/press to play. 

I believe the design is also that it loads the rest of the tracks in the current list to the playlist. Obviously that part of the model doesn't hold up well for podcasts and pandora stations, where you don't want to load the rest of the menu to the playlist. I think we need to handle those cases with some kind of flag to say not to playall in the list.
Comment 9 Andy Grundman 2009-09-04 20:02:24 UTC
Well that's the thing, most or all of these examples are not at the "lowest level" really.  For example a Rhapsody track has a huge menu underneath it.
Comment 10 Ben Klaas 2009-09-04 20:09:52 UTC
But that was true of local tracks too...now that stuff comes up in the trackinfo menu...

want to strip CAT2 and defer this to Weldon? I really think were going to get hammered for inconsistent behavior though...
Comment 11 SVN Bot 2009-09-14 12:30:51 UTC
 == Auto-comment from SVN commit #7330 to the network repo by andy ==
 == https://svn.slimdevices.com/network?view=revision&revision=7330 ==

Bug 13462, Define on_select => play for Rhapsody
Comment 12 SVN Bot 2009-09-14 12:36:09 UTC
 == Auto-comment from SVN commit #28513 to the slim repo by andy ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28513 ==

Bug 13462, flag on_select => play items as touch-to-play
Comment 13 SVN Bot 2009-09-14 12:45:48 UTC
 == Auto-comment from SVN commit #7331 to the network repo by andy ==
 == https://svn.slimdevices.com/network?view=revision&revision=7331 ==

Fixed bug 13462, define on_select => play for other services
Comment 14 Ben Klaas 2009-09-14 13:11:35 UTC
issues:
- press to play on rhapsody/napster/mp3tunes/LMA track does not load the rest of the window's playlist (also, if track N > 1 is pressed, entire playlist should be added and then jump to track N)
- pandora genre stations plays immediately but does not push to NP screen (in contrast, pandora "your stations" items work perfectly)
- IMO, "play all" items should go away entirely

works:
- podcast items work as I think they should currently (immediate play of podcast item without adding other from list), but this might break if the first issue above is addressed?
- pandora "your stations"
- last.fm (although last.fm streams themselves are down)
Comment 15 Ben Klaas 2009-09-14 13:18:16 UTC
added data point-- slacker works perfectly now
Comment 16 Andy Grundman 2009-09-14 17:57:09 UTC
Doh, S::C::XMLBrowser doesn't support the playall attribute... will have to add this.
Comment 17 Andy Grundman 2009-09-17 14:14:01 UTC
*** Bug 14105 has been marked as a duplicate of this bug. ***
Comment 18 SVN Bot 2009-09-17 19:09:34 UTC
 == Auto-comment from SVN commit #28558 to the slim repo by andy ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28558 ==

Bug 13462, support playall attribute in S::C::XMLBrowser
Comment 19 Andy Grundman 2009-09-17 19:11:37 UTC
I think this is mostly fixed now, back to Ben.
Comment 20 Ben Klaas 2009-09-17 21:22:03 UTC
Everything works except the behavior when selecting a Pandora Genre station, which I think may be able to be pushed off as a P1. Will open a bug on that one.

Nice work Andy.
Comment 21 James Richardson 2009-10-05 14:34:20 UTC
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server!
    * SqueezeCenter: 28672
    * Squeezebox 2 and 3: 130
    * Transporter: 80
    * Receiver: 65
    * Boom: 50
    * Controller: 7790
    * Radio: 7790  

Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes

If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 22 Michael Herger 2010-01-04 09:34:49 UTC
Created attachment 6417 [details]
don't make playall do addall too

Andy/Ben - as this is about _playing_ on touch, why should we change the add behaviour?

I'd suggest to revert the add behaviour, to fix some of the issues seen in bug 14848.
Comment 23 Michael Herger 2010-01-04 10:04:08 UTC
reopening
Comment 24 Michael Herger 2010-01-06 01:53:42 UTC
J�rg - how are you creating the "Add/Play all" item when browsing eg. a Rhapsody album? If I fix xmlbrowser to respect the playtrackalbum pref, then the "Add/Play all" would not handle all, but only one item.
Comment 25 Joerg Schwieder 2010-01-06 02:02:24 UTC
You mean the one at the top of the iPeng album view?
That's take from the app/play command of the menu one level above.
So if you've got an album, as, say item 1 and the tracks are items 1.0 to 1.13 then iPeng would use the play command for item 1.

Note: iPeng is NOT creating it's own command based on the IDs but is using the one from the higher level menu, that command is saved to the new menus's context before descending.

If this doesn't work with your fix, could you give me an example on how the "albums" menu looks like, I remember I'm doing some aggregation here, I think what I use is the processed action (that is: the action and base action are already merged) and I do remember there was some case where I thought this might cause trouble but it didn't when trying, would have to check.
Comment 26 Michael Herger 2010-01-06 04:19:36 UTC
Created attachment 6420 [details]
apply playtrackalbum to menu items, not when a playlist command is sent

Andy/Ben - I think we've been handling the playtrackalbum in the wrong place. We shouldn't be sending playall/addall if the user has disable this preference. IMHO this patch should fix this behaviour.

Except for iPeng... J�rg - please see my comment in bug 14848: for whatever reason the play action from iPeng is sending a different item_id than add when trying to play/add a single item from eg. a Rhapsody album. It's always sending the album's item_id for the play action, while add is using the track's id.
Comment 27 Joerg Schwieder 2010-01-06 04:33:20 UTC
This is probably OK, see my comment on the other bug.
Please check whether iPeng acts like SP if you enable "Play Single Tracks" in the iPeng settings.
Comment 28 Michael Herger 2010-01-06 05:18:08 UTC
> Please check whether iPeng acts like SP if you enable "Play Single  
> Tracks" in the iPeng settings.

Even with that option enabled iPeng is still requesting the album instead  
of the track
Comment 29 Ben Klaas 2010-01-06 06:29:36 UTC
Michael- I'm willing to concede that playalbum pref checking was done in the wrong place, however:

XMLBrowser as you know is spaghetti code. It's nearly impossible to understand which parts of that module are going to be hit for a given menu. When I'm tasked with things that involve working on code in this module, my procedure is typically trial-and-error. 

I'm fairly certain I added the $playalbum code in XMLBrowser, and its placement is probably due to the fact that when I placed it there, the bug I was working on was no longer a bug.

My preference would be to also understand how pieces of XMLBrowser are being called, but in the absence of that I adopt trial-and-error.

A rewrite of XMLBrowser to make it more modular and easier (or even possible) to understand would be the right thing to do. Unfortunately, that's an unlikely possibility.
Comment 30 Joerg Schwieder 2010-01-06 07:40:50 UTC
Actually this looks like a bug in iPeng. Seems to ignore that setting for SqueezePlay based albums.
Also found what the "limitation" was I mentioned earlier: support for "xxxAction = ..." (only in Albums, the other menus handle this correctly.
Will send you an updated iPEng later today.

Funny, didn't get any complaints about that one. You were looking for sensible defaults for TinySC: "Play Other Tracks in Album" seems to be one...
Comment 31 SVN Bot 2010-01-06 09:11:38 UTC
 == Auto-comment from SVN commit #29726 to the slim repo by michael ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29726 ==

Fixed Bug: 14848
Fixed Bug: 13462
Description: don't send playall/addall unless user has playtrackalbum pref set. I wish us all good luck!
Comment 32 Chris Owens 2010-04-08 17:25:11 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!