Fix bug in covermanager not saving album cover to DB. (#6011)
* Fix bug in covermanager not saving album cover to DB.
This commit is contained in:
parent
1732e56fe6
commit
c9d954f8a3
@ -967,7 +967,7 @@ void LibraryBackend::UpdateManualAlbumArt(const QString& artist,
|
|||||||
query.SetColumnSpec("ROWID, " + Song::kColumnSpec);
|
query.SetColumnSpec("ROWID, " + Song::kColumnSpec);
|
||||||
query.AddWhere("album", album);
|
query.AddWhere("album", album);
|
||||||
|
|
||||||
if (!albumartist.isNull()) {
|
if (!albumartist.isNull() && !albumartist.isEmpty()) {
|
||||||
query.AddWhere("albumartist", albumartist);
|
query.AddWhere("albumartist", albumartist);
|
||||||
} else if (!artist.isNull()) {
|
} else if (!artist.isNull()) {
|
||||||
query.AddWhere("artist", artist);
|
query.AddWhere("artist", artist);
|
||||||
@ -987,7 +987,7 @@ void LibraryBackend::UpdateManualAlbumArt(const QString& artist,
|
|||||||
QString(
|
QString(
|
||||||
"UPDATE %1 SET art_manual = :art"
|
"UPDATE %1 SET art_manual = :art"
|
||||||
" WHERE album = :album AND unavailable = 0").arg(songs_table_));
|
" WHERE album = :album AND unavailable = 0").arg(songs_table_));
|
||||||
if (!albumartist.isNull()) {
|
if (!albumartist.isNull() && !albumartist.isEmpty()) {
|
||||||
sql += " AND albumartist = :albumartist";
|
sql += " AND albumartist = :albumartist";
|
||||||
} else if (!artist.isNull()) {
|
} else if (!artist.isNull()) {
|
||||||
sql += " AND artist = :artist";
|
sql += " AND artist = :artist";
|
||||||
@ -996,7 +996,7 @@ void LibraryBackend::UpdateManualAlbumArt(const QString& artist,
|
|||||||
QSqlQuery q(sql, db);
|
QSqlQuery q(sql, db);
|
||||||
q.bindValue(":art", art);
|
q.bindValue(":art", art);
|
||||||
q.bindValue(":album", album);
|
q.bindValue(":album", album);
|
||||||
if (!albumartist.isNull()) {
|
if (!albumartist.isNull() && !albumartist.isEmpty()) {
|
||||||
q.bindValue(":albumartist", albumartist);
|
q.bindValue(":albumartist", albumartist);
|
||||||
} else if (!artist.isNull()) {
|
} else if (!artist.isNull()) {
|
||||||
q.bindValue(":artist", artist);
|
q.bindValue(":artist", artist);
|
||||||
|
@ -750,7 +750,7 @@ void AlbumCoverManager::LoadSelectedToPlaylist() {
|
|||||||
void AlbumCoverManager::SaveAndSetCover(QListWidgetItem* item,
|
void AlbumCoverManager::SaveAndSetCover(QListWidgetItem* item,
|
||||||
const QImage& image) {
|
const QImage& image) {
|
||||||
const QString artist = item->data(Role_ArtistName).toString();
|
const QString artist = item->data(Role_ArtistName).toString();
|
||||||
const QString albumartist = item->data(Role_ArtistName).toString();
|
const QString albumartist = item->data(Role_AlbumArtistName).toString();
|
||||||
const QString album = item->data(Role_AlbumName).toString();
|
const QString album = item->data(Role_AlbumName).toString();
|
||||||
|
|
||||||
QString path =
|
QString path =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user