|
@@ -18,7 +18,7 @@ QList<Radio *> NRJ::getRadios()
|
18
|
18
|
void NRJ::setupPlayer()
|
19
|
19
|
{
|
20
|
20
|
tries = 0;
|
21
|
|
- QNetworkReply* reply = mgr->get(QNetworkRequest(QUrl("http://players.nrjaudio.fm/live-metadata/player/nrj/v1.0/player_setup.yml")));
|
|
21
|
+ QNetworkReply* reply = mgr->get(QNetworkRequest(QUrl("http://players.nrjaudio.fm/live-metadata/player/" + radio + "/v1.0/player_setup.yml")));
|
22
|
22
|
connect(reply, SIGNAL(finished()), this, SLOT(onSetupFinished()));
|
23
|
23
|
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSetupError(QNetworkReply::NetworkError)));
|
24
|
24
|
}
|
|
@@ -29,7 +29,7 @@ void NRJ::getAllCur()
|
29
|
29
|
return;
|
30
|
30
|
tries = 0;
|
31
|
31
|
QUrl url = apiBase;
|
32
|
|
- QUrlQuery query;
|
|
32
|
+ QUrlQuery query(apiBase.query());
|
33
|
33
|
query.addQueryItem("act", "get_allcur");
|
34
|
34
|
url.setQuery(query);
|
35
|
35
|
|
|
@@ -38,6 +38,11 @@ void NRJ::getAllCur()
|
38
|
38
|
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onGetAllCurError(QNetworkReply::NetworkError)));
|
39
|
39
|
}
|
40
|
40
|
|
|
41
|
+void NRJ::setRadio(QString radio)
|
|
42
|
+{
|
|
43
|
+ this->radio = radio;
|
|
44
|
+}
|
|
45
|
+
|
41
|
46
|
void NRJ::onSetupFinished()
|
42
|
47
|
{
|
43
|
48
|
QNetworkReply* reply = (QNetworkReply*)sender();
|
|
@@ -88,7 +93,8 @@ void NRJ::onSetupError(QNetworkReply::NetworkError)
|
88
|
93
|
void NRJ::onGetAllCurFinished()
|
89
|
94
|
{
|
90
|
95
|
QNetworkReply* reply = (QNetworkReply*)sender();
|
91
|
|
- YAML::Node itms = YAML::Load(reply->readAll().constData())["itms"];
|
|
96
|
+ QByteArray str = reply->readAll();
|
|
97
|
+ YAML::Node itms = YAML::Load(str.constData())["itms"];
|
92
|
98
|
|
93
|
99
|
for(unsigned i = 0;i < itms.size(); ++i)
|
94
|
100
|
{
|