Bug 14872 - Problems with TitleFormat in last.fm and internet radios
: Problems with TitleFormat in last.fm and internet radios
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.4.1
: PC Ubuntu Linux
: P2 normal (vote)
: 7.5.0
Assigned To: Alan Young
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-21 01:43 UTC by Dieter
Modified: 2010-04-08 17:26 UTC (History)
3 users (show)

See Also:
Category: Task


Attachments
server.log file including the described errors (230.24 KB, text/plain)
2009-10-21 01:45 UTC, Dieter
Details
wrap call to track info methods in an eval() (550 bytes, patch)
2010-01-08 03:54 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dieter 2009-10-21 01:43:33 UTC
I use the TitleSwitcher and MusicInfoScreen plugins to switch display every 15 seconds between

TITLE (ARTIST) and GROUPING (COMPOSER)

i.e. for example "Molto vivace (Leonard Bernstein)" and "Symphony No. 9 (Beethoven, Ludwig van)"

GROUPING is a tag scanned with the CustomScan plugin in which I store the work title for classical music. For non-classical music GROUPING and COMPOSER are empty since I set the composer only for classical music.

Since the TitleSwitcher plugin does only switch display if the used tags are not empty, the result is that for non-classical music the display of my squeezebox always shows TITLE (ARTIST) while the switching described above takes place only for classical music. For me that is a perfect solution that takes into account that for classical music composer, artist, work, and movement (which is stored in TITLE) should be displayed while for non-classical music only artist and track title should be displayed.

This worked perfectly with SC 7.3 for all kind of music sources. In 7.4 it works only correctly for music from my local library but it does not work correctly for music from internet radios and last.fm.

For example, when I hear music from last.fm the display switches between

TITLE (ARTIST) and TITLE

If you look into the enclosed server.log it seems that there are problems with the COMPOSER tag which is not set for the last.fm music (although there are no problems with my own non-classical music for which this tag is also not set).

Same problem happens with internet radio. For example, if I hear radio station Bayern 3 the display switches between

Top-40 Pop (Bayern 3 97,3) and Top-40 Pop

Note that "Top-40 Pop" is always the contents of the TITLE tag and "Bayern 3 97,3" is the contents of the ARTIST tag for this radio station since the real artist names and titles are not transmitted. Of course the GROUPING and the COMPOSER tags are not set so it seems to be the same problem as with last.fm.

The problematic line reads:
[09-10-18 21:32:37.6650] Plugins::MusicInfoSCR::Info::getCustomTagData (351) Problem executing callback: Can't locate object method "composer" via package "Slim::Schema::RemotePlaylist" at /usr/share/perl5/Slim/Music/TitleFormatter.pm line 191.
Comment 1 Dieter 2009-10-21 01:45:10 UTC
Created attachment 6183 [details]
server.log file including the described errors
Comment 2 Michael Herger 2009-10-21 05:34:04 UTC
This is not limited to these plugins, but can also happen if somebody was to use COMPOSER in SBS' title format, then playing a radio station.


Andy - there might be tons of such potential issues. I could fix this one like this:

Index: TitleFormatter.pm
===================================================================
--- TitleFormatter.pm	(revision 28967)
+++ TitleFormatter.pm	(working copy)
@@ -183,6 +183,10 @@
 
$parsedFormats{uc($attr)} = sub {
 			
+if (blessed $_[0] && $_[0]->isa('Slim::Schema::RemoteTrack')) {
+	return '' ;
+}
+


or we wrap the execution of those code blocks in an eval()?
Comment 3 Andy Grundman 2009-10-21 05:41:36 UTC
Alan: I think RemoteTrack should probably have all the same methods as Track.
Comment 4 Alan Young 2009-10-21 09:09:57 UTC
I'm sure that there are some still missing, and some that are duplicated probably should be re-factored in some way. But I was trying to avoid duplicating all the cruft that has accumulated in Track.
Comment 5 Michael Herger 2009-10-22 23:49:20 UTC
Alan - I'm not going to do any bigger changes for a few weeks. Could you please take over?
Comment 6 Erland Isaksson 2009-11-04 20:49:29 UTC
This is what happens currently with Title Switcher and MusicInfoSCR:

1. Title Switcher calls Plugins::MusicInfoSCR::Info::getFormatString with COMPOSER
2. MusicInfoSCR has some logic related to this bug, that results in that it calls Squeezebox Server (Slim::Music::Info::displayText) with an empty string if online station and requested format tag is COMPOSER, BAND or CONDUCTOR
3. For the empty strings it looks like Slim::Music::Info::displayText returns something that looks like the title of the online radio station

Are we sure COMPOSER,BAND and CONDUCTOR never can exist for online radio stations ?
If we are, I can apply a similar fix in Title Switcher plugin as Michael already has done in MusicInfoSCR that doesn't show these values for online radio stations.

However, it really feels like this should be solved in the Squeezebox Server code and I suppose that's what this bug is all about.
Comment 7 Michael Herger 2010-01-08 03:54:14 UTC
Created attachment 6425 [details]
wrap call to track info methods in an eval()

Alan - should we simply wrap those calls in an eval()? This would make invalid calls fail silently and return nothing instead.
Comment 8 Michael Herger 2010-01-08 04:00:56 UTC
Comment on attachment 6425 [details]
wrap call to track info methods in an eval()

Nah.. that would make the full format string fail, not only the item causing a problem, eg. "ARTIST - COMPOSER" would return nothing instead of ARTIST only, if COMPOSER was undefined.
Comment 9 SVN Bot 2010-01-08 04:03:45 UTC
 == Auto-comment from SVN commit #29739 to the slim repo by michael ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29739 ==

Fixed Bug: 14872
Description: wrap contributors format evaluation as they're not always defined for eg. remote tracks
Comment 10 Chris Owens 2010-04-08 17:26:08 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!