Merge pull request #4441 from Chocobozzz/ampache
Add ampache compatibility
This commit is contained in:
commit
c957724f37
@ -374,9 +374,19 @@ void SubsonicLibraryScanner::OnGetAlbumListFinished(QNetworkReply* reply,
|
|||||||
reader.readNextStartElement();
|
reader.readNextStartElement();
|
||||||
Q_ASSERT(reader.name() == "subsonic-response");
|
Q_ASSERT(reader.name() == "subsonic-response");
|
||||||
if (reader.attributes().value("status") != "ok") {
|
if (reader.attributes().value("status") != "ok") {
|
||||||
// TODO: error handling
|
reader.readNextStartElement();
|
||||||
|
int error = reader.attributes().value("code").toString().toInt();
|
||||||
|
|
||||||
|
// Compatibility with Ampache :
|
||||||
|
// When there is no data, Ampache returns NotFound
|
||||||
|
// whereas Subsonic returns empty albumList2 tag
|
||||||
|
switch (error) {
|
||||||
|
case SubsonicService::ApiError_NotFound:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int albums_added = 0;
|
int albums_added = 0;
|
||||||
reader.readNextStartElement();
|
reader.readNextStartElement();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user