Bugzilla – Bug 14872
Problems with TitleFormat in last.fm and internet radios
Last modified: 2010-04-08 17:26:08 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.
Created attachment 6183 [details] server.log file including the described errors
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()?
Alan: I think RemoteTrack should probably have all the same methods as Track.
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.
Alan - I'm not going to do any bigger changes for a few weeks. Could you please take over?
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.
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 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.
== 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
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!