[Slim-Checkins] r8941 - in /trunk/server/Slim: Schema/Album.pm
Web/Pages/BrowseDB.pm
adrian at svn.slimdevices.com
adrian at svn.slimdevices.com
Sat Aug 12 04:01:50 PDT 2006
Author: adrian
Date: Sat Aug 12 04:01:46 2006
New Revision: 8941
URL: http://svn.slimdevices.com?rev=8941&view=rev
Log:
Bug: 3255
Description: override text used to derive anchors if sort by contributor
to align with alphabar
Modified:
trunk/server/Slim/Schema/Album.pm
trunk/server/Slim/Web/Pages/BrowseDB.pm
Modified: trunk/server/Slim/Schema/Album.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Schema/Album.pm?rev=8941&r1=8940&r2=8941&view=diff
==============================================================================
--- trunk/server/Slim/Schema/Album.pm (original)
+++ trunk/server/Slim/Schema/Album.pm Sat Aug 12 04:01:46 2006
@@ -91,7 +91,7 @@
}
sub displayAsHTML {
- my ($self, $form, $descend, $sort) = @_;
+ my ($self, $form, $descend, $sort, $anchortextRef) = @_;
$form->{'text'} = $self->title;
$form->{'coverThumb'} = $self->artwork || 0;
@@ -107,7 +107,9 @@
}
# Show the artist in the album view
- if (Slim::Utils::Prefs::get('showArtist') || ($sort && $sort =~ /^contributor\.namesort/)) {
+ my $showContributor = ($sort && $sort =~ /^contributor\.namesort/);
+
+ if (Slim::Utils::Prefs::get('showArtist') || $showContributor) {
# XXX - only show the contributor when there are multiple
# contributors in the album view.
@@ -118,6 +120,11 @@
$form->{'artist'} = $contributor;
#$form->{'includeArtist'} = defined $findCriteria->{'artist'} ? 0 : 1;
$form->{'noArtist'} = Slim::Utils::Strings::string('NO_ARTIST');
+
+ if ($showContributor) {
+ # override default field for anchors with contributor.namesort
+ $$anchortextRef = $contributor->namesort;
+ }
}
# }
}
Modified: trunk/server/Slim/Web/Pages/BrowseDB.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Web/Pages/BrowseDB.pm?rev=8941&r1=8940&r2=8941&view=diff
==============================================================================
--- trunk/server/Slim/Web/Pages/BrowseDB.pm (original)
+++ trunk/server/Slim/Web/Pages/BrowseDB.pm Sat Aug 12 04:01:46 2006
@@ -378,6 +378,7 @@
if ($count) {
my $lastAnchor = '';
+ my $anchorText;
my $attrName = lc($levelName);
my $firstItem = undef;
@@ -417,9 +418,9 @@
$form{'attributes'} .= sprintf('&%s.id=%d', $attrName, $itemid);
- $item->displayAsHTML(\%form, $descend, $orderBy);
-
- if (my $itemsort = $item->namesort) {
+ $item->displayAsHTML(\%form, $descend, $orderBy, \$anchorText);
+
+ if (my $itemsort = $anchorText || $item->namesort ) {
my $anchor = substr($itemsort, 0, 1);
More information about the checkins
mailing list