mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-15 18:58:55 +01:00
Actually check for errors in AlbumCoverFetcher.
This commit is contained in:
parent
39a97d9878
commit
3e0e3f6889
@ -65,6 +65,12 @@ void AlbumCoverFetcher::AlbumGetInfoFinished() {
|
||||
reply->deleteLater();
|
||||
quint64 id = active_requests_.take(reply);
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
// TODO: retry request.
|
||||
emit AlbumCoverFetched(id, QImage());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
lastfm::XmlQuery query(lastfm::ws::parse(reply));
|
||||
|
||||
@ -81,10 +87,16 @@ void AlbumCoverFetcher::AlbumGetInfoFinished() {
|
||||
void AlbumCoverFetcher::AlbumCoverFetchFinished() {
|
||||
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
|
||||
reply->deleteLater();
|
||||
quint64 id = active_requests_.take(reply);
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
// TODO: retry request.
|
||||
emit AlbumCoverFetched(id, QImage());
|
||||
return;
|
||||
}
|
||||
|
||||
QImage image;
|
||||
image.loadFromData(reply->readAll());
|
||||
|
||||
quint64 id = active_requests_.take(reply);
|
||||
emit AlbumCoverFetched(id, image);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user