Fix crash in last.fm radio when the user's subscription expires.
This commit is contained in:
parent
fd2daf6fa2
commit
7e7aa6a0c4
|
@ -585,27 +585,34 @@ void LastFMService::FetchMoreTracksFinished() {
|
||||||
qWarning() << "Invalid reply on radio.getPlaylist";
|
qWarning() << "Invalid reply on radio.getPlaylist";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
reply->deleteLater();
|
||||||
|
|
||||||
const XmlQuery& query = lastfm::ws::parse(reply);
|
try {
|
||||||
const XmlQuery& playlist = query["playlist"];
|
const XmlQuery& query = lastfm::ws::parse(reply);
|
||||||
foreach (const XmlQuery& q, playlist["trackList"].children("track")) {
|
const XmlQuery& playlist = query["playlist"];
|
||||||
lastfm::MutableTrack t;
|
foreach (const XmlQuery& q, playlist["trackList"].children("track")) {
|
||||||
t.setUrl(q["location"].text());
|
lastfm::MutableTrack t;
|
||||||
t.setExtra("trackauth", q["extension"]["trackauth"].text());
|
t.setUrl(q["location"].text());
|
||||||
t.setTitle(q["title"].text());
|
t.setExtra("trackauth", q["extension"]["trackauth"].text());
|
||||||
t.setArtist(q["creator"].text());
|
t.setTitle(q["title"].text());
|
||||||
t.setAlbum(q["album"].text());
|
t.setArtist(q["creator"].text());
|
||||||
t.setDuration(q["duration"].text().toInt() / 1000);
|
t.setAlbum(q["album"].text());
|
||||||
t.setSource(lastfm::Track::LastFmRadio);
|
t.setDuration(q["duration"].text().toInt() / 1000);
|
||||||
const QString& image = q["image"].text();
|
t.setSource(lastfm::Track::LastFmRadio);
|
||||||
if (!image.isEmpty()) {
|
const QString& image = q["image"].text();
|
||||||
FetchImage(t, image);
|
if (!image.isEmpty()) {
|
||||||
|
FetchImage(t, image);
|
||||||
|
}
|
||||||
|
playlist_ << t;
|
||||||
}
|
}
|
||||||
playlist_ << t;
|
} catch (lastfm::ws::ParseError& e) {
|
||||||
|
qDebug() << "Lastfm parse error:" << e.enumValue();
|
||||||
|
} catch (std::runtime_error& e) {
|
||||||
|
qDebug() << e.what();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TunerTrackAvailable();
|
TunerTrackAvailable();
|
||||||
reply->deleteLater();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LastFMService::Tune(const lastfm::RadioStation& station) {
|
void LastFMService::Tune(const lastfm::RadioStation& station) {
|
||||||
|
|
Loading…
Reference in New Issue