[Slim-Checkins] r8870 - in /trunk/server: Changelog6.html Slim/Music/Artwork.pm Slim/Utils/Misc.pm

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Tue Aug 8 13:44:42 PDT 2006


Author: dsully
Date: Tue Aug  8 13:44:41 2006
New Revision: 8870

URL: http://svn.slimdevices.com?rev=8870&view=rev
Log:
Bug: 3841
Description: Fix artwork scan to happen via BMF as well.

Modified:
    trunk/server/Changelog6.html
    trunk/server/Slim/Music/Artwork.pm
    trunk/server/Slim/Utils/Misc.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=8870&r1=8869&r2=8870&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Tue Aug  8 13:44:41 2006
@@ -463,6 +463,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3834">#3834</a> - build-perl-modules.pl assumes that which exits with an error status</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3835">#3835</a> - Cannot not group Various Artists</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3837">#3837</a> - Digital Input plugin should only appear on transporters</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3841">#3841</a> - Thumbnail artwork not displayed properly after normal scan</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3842">#3842</a> - Playing a magic favorite has some problems.</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3843">#3843</a> - Undefined subroutine &Slim::Networking::Async::Socket::UDP::msg</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3844">#3844</a> - Synced players - problem moving track past 'now playing' ...</li>

Modified: trunk/server/Slim/Music/Artwork.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Music/Artwork.pm?rev=8870&r1=8869&r2=8870&view=diff
==============================================================================
--- trunk/server/Slim/Music/Artwork.pm (original)
+++ trunk/server/Slim/Music/Artwork.pm Tue Aug  8 13:44:41 2006
@@ -9,6 +9,7 @@
 
 use strict;
 
+use File::Basename qw(dirname);
 use File::Slurp;
 use File::Spec::Functions qw(:ALL);
 use Path::Class;
@@ -29,10 +30,32 @@
 
 # Public class methods
 sub findArtwork {
-	my $class  = shift;
+	my $class = shift;
+	my $track = shift;
+
+	# Only look for track/album combos that don't already have artwork.
+	my $cond = {
+		'me.audio'      => 1,
+		'album.artwork' => { '=' => undef },
+	};
+
+	my $attr = {
+		'join'     => 'album',
+		'group_by' => 'album',
+	};
+
+	# If the user passed in a track (dir) object, match on that base directory.
+	if (blessed($track) && $track->content_type eq 'dir') {
+
+		$cond->{'me.url'} = { 'like' => sprintf('%s%%', $track->url) };
+
+	} elsif (blessed($track) && $track->audio) {
+
+		$cond->{'me.url'} = { 'like' => sprintf('%s%%', dirname($track->url)) };
+	}
 
 	# Find distinct albums to check for artwork.
-	my $tracks = Slim::Schema->search('Track', { 'audio' => 1 }, { 'group_by' => 'album' });
+	my $tracks = Slim::Schema->search('Track', $cond, $attr);
 
 	my $progress = undef;
 	my $count    = $tracks->count;

Modified: trunk/server/Slim/Utils/Misc.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Misc.pm?rev=8870&r1=8869&r2=8870&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Misc.pm (original)
+++ trunk/server/Slim/Utils/Misc.pm Tue Aug  8 13:44:41 2006
@@ -741,6 +741,9 @@
 		});
 	}
 
+	# Bug: 3841 - check for new artwork
+	Slim::Music::Artwork->findArtwork($topLevelObj);
+
 	# Now read the raw directory and return it. This should always be really fast.
 	my $items = [ Slim::Music::Info::sortFilename( readDirectory($path) ) ];
 	my $count = scalar @$items;



More information about the checkins mailing list