Fix deleting multiple covers in album cover manager

This commit is contained in:
Jonas Kvinge
2021-03-07 03:43:49 +01:00
parent bbcd6a3261
commit 04bbff338d
4 changed files with 23 additions and 23 deletions

View File

@@ -347,16 +347,16 @@ QUrl AlbumCoverChoiceController::UnsetCover(Song *song) {
}
void AlbumCoverChoiceController::ClearCover(Song *song) {
void AlbumCoverChoiceController::ClearCover(Song *song, const bool clear_art_automatic) {
if (!song->url().isLocalFile() || song->effective_albumartist().isEmpty() || song->album().isEmpty()) return;
song->clear_art_manual();
SaveArtManualToSong(song, QUrl());
SaveArtManualToSong(song, QUrl(), clear_art_automatic);
}
bool AlbumCoverChoiceController::DeleteCover(Song *song) {
bool AlbumCoverChoiceController::DeleteCover(Song *song, const bool manually_unset) {
if (!song->url().isLocalFile() || song->effective_albumartist().isEmpty() || song->album().isEmpty()) return false;
@@ -399,7 +399,10 @@ bool AlbumCoverChoiceController::DeleteCover(Song *song) {
}
else song->clear_art_manual();
if (success) UnsetCover(song);
if (success) {
if (manually_unset) UnsetCover(song);
else ClearCover(song, true);
}
return success;