Be more forgiving when fetching albums/songs
This commit is contained in:
parent
8964c8131f
commit
665f7af929
@ -137,6 +137,7 @@ PlaylistItemList SubsonicDynamicPlaylist::GenerateMoreSongs(int count) {
|
|||||||
qLog(Warning) << "An error occurred fetching data. Code: " << error
|
qLog(Warning) << "An error occurred fetching data. Code: " << error
|
||||||
<< " Message: "
|
<< " Message: "
|
||||||
<< reader.attributes().value("message").toString();
|
<< reader.attributes().value("message").toString();
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.readNextStartElement();
|
reader.readNextStartElement();
|
||||||
@ -147,8 +148,9 @@ PlaylistItemList SubsonicDynamicPlaylist::GenerateMoreSongs(int count) {
|
|||||||
|
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() != "song") {
|
if (reader.name() != "song") {
|
||||||
qLog(Warning) << "song tag expected. Aborting playlist fetch";
|
qLog(Warning) << "song tag expected. Skipping song";
|
||||||
return items;
|
reader.skipCurrentElement();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Song song = ReadSong(service, reader);
|
Song song = ReadSong(service, reader);
|
||||||
@ -209,6 +211,7 @@ PlaylistItemList SubsonicDynamicPlaylist::GenerateMoreAlbums(int count) {
|
|||||||
qLog(Warning) << "An error occurred fetching data. Code: " << error
|
qLog(Warning) << "An error occurred fetching data. Code: " << error
|
||||||
<< " Message: "
|
<< " Message: "
|
||||||
<< reader.attributes().value("message").toString();
|
<< reader.attributes().value("message").toString();
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.readNextStartElement();
|
reader.readNextStartElement();
|
||||||
@ -219,8 +222,9 @@ PlaylistItemList SubsonicDynamicPlaylist::GenerateMoreAlbums(int count) {
|
|||||||
|
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() != "album") {
|
if (reader.name() != "album") {
|
||||||
qLog(Warning) << "album tag expected. Aboring playlist fetch";
|
qLog(Warning) << "album tag expected. Skipping album";
|
||||||
return items;
|
reader.skipCurrentElement();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
qLog(Debug) << "Getting album: "
|
qLog(Debug) << "Getting album: "
|
||||||
@ -279,8 +283,9 @@ void SubsonicDynamicPlaylist::GetAlbum(SubsonicService* service,
|
|||||||
// Read song information
|
// Read song information
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() != "song") {
|
if (reader.name() != "song") {
|
||||||
qLog(Warning) << "song tag expected. Aborting playlist fetch.";
|
qLog(Warning) << "song tag expected. Skipping song";
|
||||||
return;
|
reader.skipCurrentElement();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Song song = ReadSong(service, reader);
|
Song song = ReadSong(service, reader);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user