[Slim-Checkins] r15396 - /trunk/server/Slim/Schema.pm
andy at svn.slimdevices.com
andy at svn.slimdevices.com
Mon Dec 17 14:31:37 PST 2007
Author: andy
Date: Mon Dec 17 14:31:37 2007
New Revision: 15396
URL: http://svn.slimdevices.com?rev=15396&view=rev
Log:
Artwork cache should be wiped along with database data, since it references track IDs that will change on the next scan, resulting in wrong artwork
Modified:
trunk/server/Slim/Schema.pm
Modified: trunk/server/Slim/Schema.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Schema.pm?rev=15396&r1=15395&r2=15396&view=diff
==============================================================================
--- trunk/server/Slim/Schema.pm (original)
+++ trunk/server/Slim/Schema.pm Mon Dec 17 14:31:37 2007
@@ -30,6 +30,7 @@
use DBIx::Migration;
use File::Basename qw(dirname);
+use File::Path qw(rmtree);
use File::Spec::Functions qw(:ALL);
use List::Util qw(max);
use Scalar::Util qw(blessed);
@@ -1327,6 +1328,14 @@
$self->lastTrack({});
logger('scan.import')->info("Wiped all in-memory caches.");
+
+ # Clear the artwork cache, since it will contain cached items with IDs
+ # that are no longer valid. Just delete the directory because clearing the
+ # cache takes too long
+ my $artworkCacheDir = catdir( $prefs->get('cachedir'), 'Artwork' );
+ eval { rmtree( $artworkCacheDir, { verbose => 0 } ); };
+
+ logger('scan.import')->info("Wiped artwork cache.");
}
=head2 wipeAllData()
More information about the checkins
mailing list