Bug 3898 - 'Now Playing' in web interface shows Artist and Album twice
: 'Now Playing' in web interface shows Artist and Album twice
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.5b1
: PC Windows XP
: P2 normal (vote)
: Future
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-09 10:03 UTC by sbjaerum
Modified: 2008-12-15 13:07 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
Image showing the duplicated info (110.64 KB, image/jpeg)
2006-08-09 10:04 UTC, sbjaerum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sbjaerum 2006-08-09 10:03:40 UTC
With 6.5 r8881, using Default skin and Firefox on WinXP, I see the following:

In the 'Now Playing' part of the web interface I see <Track> from <Album> by <Artist> from <Album> by <Artist>.
The album and artist are shown twice.
I will upload an image that illustrates the problem.
Comment 1 sbjaerum 2006-08-09 10:04:34 UTC
Created attachment 1410 [details]
Image showing the duplicated info
Comment 2 KDF 2006-08-09 10:59:06 UTC
I expect you have your titleformat set to TITLE by ARTIST ?
changing titleformat to TITLE will clear that up as a workaround

the handling of 'includeArtist' and 'includeAlbum' is clearly a bit flakey in places.
Comment 3 Chris Owens 2006-08-09 12:30:00 UTC
Please let us know if that cleared it up.
Comment 4 sbjaerum 2006-08-09 13:01:39 UTC
Changing Title Format to TITLE clears up this problem.
And I still get from <Album> by <Artist>. Why?
May be the titleformat 'TITLE from ALBUM by ARTIST' is of no use?

Comment 5 KDF 2006-08-09 13:35:19 UTC
Why...is because the title format is use for the song link.  The from... and by... provide album and artist links when artist or title arent' used in the TITLEFORMAT.  it's confusing and, personally, I think the only format that should be used is TITLE since it isn't practical to provide a flexible format with links on each.

The design is still broken as the server should be telling the skins about the content of the titleformat so that redundancies do not come up.  The change is really for a workaround :)
Comment 6 Chris Owens 2006-08-09 13:37:04 UTC
I took the liberty of setting this to fix after 6.5.  If you feel like looking at it before then, Dan, you are of course welcome to.
Comment 7 KDF 2006-08-09 13:45:41 UTC
This is a really simple fix, which I'll put in tonight.

HTML/Default/status_header.html:

line 169 changes to:
[% IF itemobj.album.title && itemobj.album.title != noAlbum  && includeAlbum %]

line 177 changes to:
[% IF itemobj.artist && itemobj.artist != noArtist && includeArtist %]

post 6.5 task might be to look at the titleformat design.  reconsider the purpose of the formatting of what is just a title link, and the purpose of having the artist and album links.  Maybe they should ONLY be there if format is just TITLE or maybe they can be replacing ALBUM and ARTIST only when included in the titleformat.  etc etc.
Comment 8 KDF 2006-08-09 20:34:41 UTC
fixed in change 8903 well enough for now.  I'll leave open but feel free to close if you feel so inclined.
Comment 9 sbjaerum 2006-08-11 09:46:32 UTC
For the above fix to have the intended effect, I believe the following (or a similar) patch is needed:

Index: server/Slim/Web/Pages/Status.pm
===================================================================
--- server/Slim/Web/Pages/Status.pm	(revision 8930)
+++ server/Slim/Web/Pages/Status.pm	(working copy)
@@ -190,7 +190,16 @@
 			$params->{'current_playlist_name'} = Slim::Music::Info::standardTitle($client, $client->currentPlaylist);
 		}
 	}
+	
+	my $format = Slim::Utils::Prefs::getInd("titleFormat", Slim::Utils::Prefs::get("titleFormatWeb"));
+	if ($format !~ /ARTIST/) {
+		$params->{'includeArtist'} = 1;
+	}
 
+	if ($format !~ /ALBUM/) {
+		$params->{'includeAlbum'}  = 1;
+	}
+
 	return Slim::Web::HTTP::filltemplatefile($params->{'omit_playlist'} ? "status_header.html" : "status.html" , $params);
 }
Comment 10 sbjaerum 2006-08-14 10:34:48 UTC
KDF, I took the liberty to add you to the CC list in order to get your opinion on my additional patch above.
Comment 11 KDF 2006-08-14 10:54:02 UTC
that might not be the right place Since we have a displayAsHTML routine for track results, it would make sense to use that existing code.  however, I had tested this so I'll have to check back to find out why this changed.
Comment 12 sbjaerum 2006-08-14 11:26:57 UTC
As I understand it, it is Slim/Web/Pages/Status.pm that supplies the data to status_header.html.
If includeArtist and includeAlbum is not set in Status.pm, these variables will always be false in status_header.html, and the if statements will never be true.
Comment 13 KDF 2006-08-14 11:47:48 UTC
correct.
Comment 14 KDF 2006-08-14 11:54:37 UTC
try:
Slim::Player::Playlist::song($client)->displayAsHTML($params);

at line 154 of Status.pm instead.  This will leverage existing code.
Comment 15 sbjaerum 2006-08-14 12:50:24 UTC
That works, and is the preferred solution. Thanks.
Comment 16 KDF 2006-08-14 20:14:37 UTC
fixed at change 8964
Comment 17 James Richardson 2008-12-15 13:07:37 UTC
This bug appears to have been fixed in the latest release!

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.

Make sure to include the version number of the software you are seeing the error with.