Bugzilla – Bug 18050
Duration is not shown correctly
Last modified: 2013-09-12 08:02:59 UTC
The array Slim::Control::XMLBrowser::mapAttributes has a bug when showing the duration of a track. It misses the 'Duration' item when printing out. The suggested fix is: {key => 'duration', args => ['LENGTH'], func => sub { my ($value, @args) = @_; - return sprintf('%s: %s:%02s', int($value / 60), $value % 60); + return sprintf('%s: %s:%02s', $args[0], int($value / 60), $value % 60); }, },
Thanks for the heads up. I had fixed this in 7.8 while working on the Podcast plugin, but never backported the fix to 7.7... Now in 7.7.4. commit 6d9fea0fd31b48156c90bec0f55737ef6c59cc11
When playing MOG, the duration displayed in the web interface's current playlist is in total seconds rather than being formatted. Is this related in any way?
> When playing MOG, the duration displayed in the web interface's current > playlist is in total seconds rather than being formatted. Is this related in > any way? Ahm... where is the total play time shown?
I agree with McAtee. When the web interface of SLIM is showing the track info of remote tracks (no action items defined) the duration is shown in seconds. It looks like this: Title: Psalm URL: googlemusic:track:48215639-8fd0-3afd-ac87-5dbcdf8d3785 Bitrate: 320 kbps Duration: 395 I was trying to find the place where this output is generated, but without success.
> I agree with McAtee. When the web interface of SLIM is showing the track > info of remote tracks (no action items defined) the duration is shown in > seconds. It looks like this: > > Duration: 395 This is implemented in the service's protocol handler. As you're using a 3rd party plugin please get in touch with its author. Jim was talking about a total playlist type - which I don't know where he's seeing.
Created attachment 7703 [details] screen capture: web interface, MOG current playlist This is in the web interface, current playlist. Set to 'Hide Artwork', with a title format of 'TRACKNUM. TITLE (DURATION)'.
(In reply to comment #6) > This is in the web interface, current playlist. Set to 'Hide Artwork', with > a title format of 'TRACKNUM. TITLE (DURATION)'. I agree on this.
(In reply to comment #5) > > Duration: 395 > > This is implemented in the service's protocol handler. It is not implemented in the protocol handler. It is the default web interface track info page (not Menu::TrackInfo), which fetches the information from the opml feed, where I set the duration in seconds. It looks like this: my $menu = { 'name' => $track->{'title'}, 'line1' => $track->{'title'}, 'url' => $track->{'uri'}, 'image' => Plugins::GoogleMusic::Image->uri($track->{'albumArtUrl'}), 'secs' => $secs, 'duration' => $secs, 'bitrate' => 320, 'type' => 'audio', 'play' => $track->{'uri'}, 'playall' => $playall, }; > As you're using a 3rd > party plugin please get in touch with its author. I'm the author of this ;-)
(In reply to comment #4) > Title: Psalm > URL: googlemusic:track:48215639-8fd0-3afd-ac87-5dbcdf8d3785 > Bitrate: 320 kbps > Duration: 395 > > I was trying to find the place where this output is generated, but without > success. Finally, I found the root cause of this. It is in HTML/EN/xmlbrowser_details.html [% IF streaminfo.item.duration %] [% item = streaminfo.item.duration | html; title = "LENGTH"; PROCESS songInfoItem %] [% END %]
Thinking of this, brings me to the idea that Slim::Control::XMLBrowser::mapAttributes is wrong and HTML/EN/xmlbrowser_details.html is correct. The attribute duration should be formatted like %s:%02s as in Slim::Menu::TrackInfo. Thus Slim::Control::XMLBrowser::mapAttributes should look like {key => 'duration', args => ['LENGTH'], func => sub { my ($value, @args) = @_; return sprintf('%s: %s', $args[0], $value); }, },
> It is not implemented in the protocol handler. It is the default web Then you should change it ;-). > interface track info page (not Menu::TrackInfo), which fetches the What's the "default web interface track info page"? The default page handler as I know it _does_ call Slim::Menu::TrackInfo to get that information. > information from the opml feed, where I set the duration in seconds. It > looks like this: I'm not sure yet how exactly that information is routed. But what would happen if you removed the duration value from that hash? Or made it the formatted value? IIRC secs should be good enough to get the numerical duration if needed. JJZolx' case (Now Playing playlist) shold be fixed now in 7.8 (commit 59809d935f3d70a08472f782cc934439f1fc13ae).
(In reply to comment #11) > > It is not implemented in the protocol handler. It is the default web > > Then you should change it ;-). ... in the near future, yes :-) > > > interface track info page (not Menu::TrackInfo), which fetches the > > What's the "default web interface track info page"? The default page handler > as I know it _does_ call Slim::Menu::TrackInfo to get that information. As stated earlier, the comes from HTML/EN/xmlbrowser_details.html > I'm not sure yet how exactly that information is routed. But what would > happen if you removed the duration value from that hash? If I remove it, it disappears. > Or made it the > formatted value? If I format it, it looks correct, but the controller does not show the correct duration. That's why I think the Slim::Control::XMLBrowser::mapAttributes should NOT format it.