Author: agrundman
Date: Thu Nov 10 09:17:57 2011
New Revision: 33687
URL: http://svn.slimdevices.com/slim?rev=33687&view=rev
Log:
Fixed bug 17283. lastAlbum cache was left over even if the album was removed because it no longer had any tracks. Now clear the lastAlbum cache if we remove the album in the cache
Modified:
7.7/trunk/server/Changelog7.html
7.7/trunk/server/Slim/Schema.pm
7.7/trunk/server/Slim/Schema/Album.pm
Modified: 7.7/trunk/server/Changelog7.html
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Changelog7.html?rev=33687&r1=33686&r2=33687&view=diff
==============================================================================
--- 7.7/trunk/server/Changelog7.html (original)
+++ 7.7/trunk/server/Changelog7.html Thu Nov 10 09:17:57 2011
@@ -8,6 +8,7 @@
<li>Bug Fixes:</li>
<ul>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17283">#17283</a> - Scanner can crash when renaming files and performing a rescan</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17639">#17639</a> - Rescan buttons scans the wrong folder</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17643">#17643</a> - Displayed playlist not refreshed on repeat with reshuffle</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17647">#17647</a> - "Generic OPML Browser" plugin needs to be forced enabled</li>
Modified: 7.7/trunk/server/Slim/Schema.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Schema.pm?rev=33687&r1=33686&r2=33687&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Schema.pm (original)
+++ 7.7/trunk/server/Slim/Schema.pm Thu Nov 10 09:17:57 2011
@@ -61,7 +61,7 @@
our ($_unknownArtist, $_unknownGenre, $_unknownAlbumId) = ('', '', undef);
# Hash of stuff about the last Album created
-our $lastAlbum;
+our $lastAlbum = {};
# Optimization to cache content type for track entries rather than look them up everytime.
tie our %contentTypeCache, 'Tie::Cache::LRU::Expires', EXPIRES => 300, ENTRIES => 128;
@@ -2063,8 +2063,23 @@
$self->lastTrackURL('');
$self->lastTrack({});
+ $lastAlbum = {};
main::INFOLOG && logger('scan.import')->info("Wiped all in-memory caches.");
+}
+
+=head2 wipeLastAlbumCache($id)
+
+Wipe the lastAlbum cache, if it contains the album $id
+
+=cut
+
+sub wipeLastAlbumCache {
+ my ( $self, $id ) = @_;
+
+ if ( defined $id && exists $lastAlbum->{id} && $lastAlbum->{id} == $id ) {
+ $lastAlbum = {};
+ }
}
=head2 wipeAllData()
Modified: 7.7/trunk/server/Slim/Schema/Album.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Schema/Album.pm?rev=33687&r1=33686&r2=33687&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Schema/Album.pm (original)
+++ 7.7/trunk/server/Slim/Schema/Album.pm Thu Nov 10 09:17:57 2011
@@ -284,6 +284,9 @@
if ( !$count ) {
main::DEBUGLOG && $slog->is_debug && $slog->debug("Removing unused album: $id");
$dbh->do( "DELETE FROM albums WHERE id = ?", undef, $id );
+
+ # Bug 17283, this removed album may be cached as lastAlbum in Schema
+ Slim::Schema->wipeLastAlbumCache($id);
}
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.