mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Implement fetching box art
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QSslKey>
|
#include <QSslKey>
|
||||||
|
#include <QImageReader>
|
||||||
|
|
||||||
#define REQUEST_TIMEOUT_MS 5000
|
#define REQUEST_TIMEOUT_MS 5000
|
||||||
|
|
||||||
@@ -244,6 +245,20 @@ NvHTTP::verifyResponseStatus(QString xml)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage
|
||||||
|
NvHTTP::getBoxArt(int appId)
|
||||||
|
{
|
||||||
|
QNetworkReply* reply = openConnection(m_BaseUrlHttps,
|
||||||
|
"appasset",
|
||||||
|
"appid="+QString::number(appId)+
|
||||||
|
"&AssetType=2&AssetIdx=0",
|
||||||
|
true);
|
||||||
|
QImage image = QImageReader(reply).read();
|
||||||
|
delete reply;
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray
|
QByteArray
|
||||||
NvHTTP::getXmlStringFromHex(QString xml,
|
NvHTTP::getXmlStringFromHex(QString xml,
|
||||||
QString tagName)
|
QString tagName)
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ public:
|
|||||||
QVector<NvApp>
|
QVector<NvApp>
|
||||||
getAppList();
|
getAppList();
|
||||||
|
|
||||||
|
QImage
|
||||||
|
getBoxArt(int appId);
|
||||||
|
|
||||||
QUrl m_BaseUrlHttp;
|
QUrl m_BaseUrlHttp;
|
||||||
QUrl m_BaseUrlHttps;
|
QUrl m_BaseUrlHttps;
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user