Index: server/Slim/Music/Artwork.pm =================================================================== --- server/Slim/Music/Artwork.pm (revision 16744) +++ server/Slim/Music/Artwork.pm (working copy) @@ -89,7 +89,7 @@ while (my $track = $tracks->next) { - if ($track->coverArt) { + if ($track->coverArtExists) { my $album = $track->album; Index: server/Slim/Schema/Track.pm =================================================================== --- server/Slim/Schema/Track.pm (revision 16744) +++ server/Slim/Schema/Track.pm (working copy) @@ -301,15 +301,14 @@ } } - # kick this back up to the webserver so we can set last-modified - if (defined $path && $path ne 1) { + + if (defined $path) { $self->cover($path); $self->update; - $mtime = (stat($path))[9]; - } else { - $mtime = 0; + # kick this back up to the webserver so we can set last-modified + $mtime = $path ne 1 ? (stat($path))[9] : (stat($self->path))[9]; } # This is a hack, as Template::Stash::XS calls us in list context, @@ -336,7 +335,7 @@ sub coverArtExists { my $self = shift; - return defined($self->coverArt); + return $self->cover || defined($self->coverArt); } sub path { Index: server/Slim/Web/Pages/BrowseDB.pm =================================================================== --- server/Slim/Web/Pages/BrowseDB.pm (revision 16744) +++ server/Slim/Web/Pages/BrowseDB.pm (working copy) @@ -474,7 +474,7 @@ && (defined $params->{'album.id'} || defined $params->{'age.id'}) ) { - if ($firstItem->can('coverArt') && $firstItem->coverArt) { + if ($firstItem->can('coverArtExists') && $firstItem->coverArtExists) { $params->{'coverArt'} = $firstItem->id; if (!$firstItem->album->artwork) { Index: server/Slim/Web/Pages/BrowseTree.pm =================================================================== --- server/Slim/Web/Pages/BrowseTree.pm (revision 16744) +++ server/Slim/Web/Pages/BrowseTree.pm (working copy) @@ -151,7 +151,7 @@ push @{$params->{'browse_items'}}, \%form; - if (!$params->{'coverArt'} && $item->coverArt) { + if (!$params->{'coverArt'} && $item->coverArtExists) { $params->{'coverArt'} = $item->id; } } Index: server/Slim/Web/Graphics.pm =================================================================== --- server/Slim/Web/Graphics.pm (revision 16744) +++ server/Slim/Web/Graphics.pm (working copy) @@ -168,6 +168,8 @@ return ($cachedImage->{'body'}, $cachedImage->{'mtime'}, $inode, $cachedImage->{'size'}, $cachedImage->{'contentType'}); } + } else { + $log->info(" cached image not usable because 'orig' undef"); } } } @@ -441,16 +443,19 @@ } if ($cacheKey) { - + + my $imageFilePath = blessed($obj) ? $obj->cover : 0; + $imageFilePath = $obj->path if $imageFilePath eq 1; + my $cached = { - 'orig' => blessed($obj) ? $obj->cover : 0, + 'orig' => $imageFilePath, # '0' means no file to check mtime against 'mtime' => $mtime, 'body' => $body, 'contentType' => $requestedContentType, 'size' => $size, }; - $log->info(" caching result key: $cacheKey"); + $log->info(" caching result key: $cacheKey, orig=$imageFilePath"); $cache->set($cacheKey, $cached, "10days"); }