Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions SQL/SQLite/schema_27_down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- SQLite doesn't support DROP COLUMN directly
-- This is a no-op; the column will remain but be unused
3 changes: 3 additions & 0 deletions SQL/SQLite/schema_27_up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Add cover column to albums for standalone album artwork (e.g., box set covers)
-- that may not be associated with any specific track
ALTER TABLE albums ADD COLUMN cover text;
1 change: 1 addition & 0 deletions SQL/mysql/schema_27_down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE albums DROP COLUMN cover;
3 changes: 3 additions & 0 deletions SQL/mysql/schema_27_up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Add cover column to albums for standalone album artwork (e.g., box set covers)
-- that may not be associated with any specific track
ALTER TABLE albums ADD COLUMN cover text;
12 changes: 12 additions & 0 deletions Slim/Control/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use Slim::Utils::Misc;
use Slim::Utils::Prefs;
use Slim::Utils::OSDetect;
use Slim::Utils::Scanner::Local;
use Slim::Music::Artwork;

my $log = logger('control.command');

Expand Down Expand Up @@ -2756,12 +2757,18 @@ sub rescanCommand {

my $dbh = Slim::Schema->dbh;
my $sth = $dbh->prepare_cached('DELETE FROM scanned_files WHERE url = ?');
my %albumIds;
my @paths = Slim::Utils::Misc::uniq(
map {
# reset the track's timestamp so changes are certainly picked up
$_->timestamp(0);
$_->update;

if ( my $album = $_->album ) {
my $albumId = $album->id;
$albumIds{$albumId} = 1 if defined $albumId;
}

# delete entry in scanned_files - otherwise rescan doesn't handle deletions for non-recursive scans
$sth->execute($_->url);

Expand All @@ -2779,6 +2786,11 @@ sub rescanCommand {
types => 'audio',
recursive => 0,
} ) if scalar @paths;

my @albumIds = keys %albumIds;
if ( @albumIds ) {
Slim::Music::Artwork->updateDiscSetArtwork( albums => \@albumIds );
}
}
else {
# In-process scan
Expand Down
Loading