From 3338174a1f12c7c57fc4233937aa874e81748af9 Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Thu, 8 Mar 2012 23:44:35 +0100 Subject: [PATCH] Do not set cover for Grooveshark songs if we don't have one. This wrongly gives the impression that these songs have a cover --- src/internet/groovesharkservice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internet/groovesharkservice.cpp b/src/internet/groovesharkservice.cpp index 5139ab1d2..a0ecf41b5 100644 --- a/src/internet/groovesharkservice.cpp +++ b/src/internet/groovesharkservice.cpp @@ -1452,10 +1452,12 @@ Song GroovesharkService::ExtractSong(const QVariantMap& result_song) { QString artist_name = result_song["ArtistName"].toString(); int album_id = result_song["AlbumID"].toInt(); QString album_name = result_song["AlbumName"].toString(); - QString cover = result_song["CoverArtFilename"].toString(); qint64 duration = result_song["EstimateDuration"].toInt() * kNsecPerSec; song.Init(song_name, artist_name, album_name, duration); - song.set_art_automatic(QString(kUrlCover) + cover); + QVariant cover = result_song["CoverArtFilename"]; + if (cover.isValid()) { + song.set_art_automatic(QString(kUrlCover) + cover.toString()); + } QVariant track_number = result_song["TrackNum"]; if (track_number.isValid()) { song.set_track(track_number.toInt());