[Slim-Checkins] r10966 - in /branches/6.5/server: Changelog6.html HTML/Default/status_list.html Slim/Schema/Track.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Thu Dec 14 12:29:51 PST 2006


Author: adrian
Date: Thu Dec 14 12:29:51 2006
New Revision: 10966

URL: http://svn.slimdevices.com?rev=10966&view=rev
Log:
Bug: 4600
Description: merge from trunk -r 10931:10932 & 10960:10961 to improve
cpu hit of playlist update

Added:
    branches/6.5/server/HTML/Default/status_list.html
      - copied unchanged from r10961, trunk/server/HTML/Default/status_list.html
Modified:
    branches/6.5/server/Changelog6.html
    branches/6.5/server/Slim/Schema/Track.pm

Modified: branches/6.5/server/Changelog6.html
URL: http://svn.slimdevices.com/branches/6.5/server/Changelog6.html?rev=10966&r1=10965&r2=10966&view=diff
==============================================================================
--- branches/6.5/server/Changelog6.html (original)
+++ branches/6.5/server/Changelog6.html Thu Dec 14 12:29:51 2006
@@ -126,6 +126,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4550">#4550</a> - titles command find playlists & playlists search broken</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4522">#4522</a> - MMS-only streams don't work even with wmadec</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4536">#4536</a> - player search -> all songs plays nothing</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4600">#4600</a> - Reduce cpu hit of playlist refresh</li>
 	</ul>
 </ul>
 

Modified: branches/6.5/server/Slim/Schema/Track.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Schema/Track.pm?rev=10966&r1=10965&r2=10966&view=diff
==============================================================================
--- branches/6.5/server/Slim/Schema/Track.pm (original)
+++ branches/6.5/server/Slim/Schema/Track.pm Thu Dec 14 12:29:51 2006
@@ -42,6 +42,9 @@
 	}
 
 	$class->resultset_class('Slim::Schema::ResultSet::Track');
+
+	# Simple caching as artistsWithAttributes is expensive.
+	$class->mk_group_accessors('simple' => 'cachedArtistsWithAttributes');
 }
 
 # Wrappers - to make sure that the UTF-8 code is called. I really just want to
@@ -102,6 +105,10 @@
 
 sub artistsWithAttributes {
 	my $self = shift;
+
+	if ($self->cachedArtistsWithAttributes) {
+		return $self->cachedArtistsWithAttributes;
+	}
 
 	my @objs = ();
 
@@ -119,6 +126,8 @@
 		}
 	}
 
+	$self->cachedArtistsWithAttributes(\@objs);
+
 	return \@objs;
 }
 



More information about the checkins mailing list