diff --git a/saoriaccount.cpp b/saoriaccount.cpp index a9eebc0..fc9144c 100644 --- a/saoriaccount.cpp +++ b/saoriaccount.cpp @@ -114,10 +114,11 @@ QUrl url = instance()->timelineUrl(timeline); if (url.isEmpty()) return; QNetworkRequest request = createHearder(); - request.setUrl(url); + request.setUrl(instance()->addQuery(url,"limit","10")); auto *reply = SaoriApplication::saori()->manager->get(request); connect(reply,&QNetworkReply::finished,[=](){ if (reply->error() == QNetworkReply::NoError) { + qDebug() << request.url().toString(); QByteArray data = reply->readAll(); emit apiData(timeline,data); } diff --git a/saoridon.cpp b/saoridon.cpp index 7cea4b7..b8094eb 100644 --- a/saoridon.cpp +++ b/saoridon.cpp @@ -178,3 +178,13 @@ return m_timelineMap[timeline]; } +const QUrl Saoridon::addQuery(const QUrl url, const QString key, const QString value) +{ + QUrl newurl = url; + QUrlQuery query(url.query()); + query.addQueryItem(key,value); + newurl.setQuery(query); + return newurl; + +} + diff --git a/saoridon.h b/saoridon.h index 6b23229..7cbd849 100644 --- a/saoridon.h +++ b/saoridon.h @@ -51,6 +51,7 @@ const QString getAccessToken(const QString code); const QString instanceInfo(const QString key); const QUrl timelineUrl(const QString timeline); + static const QUrl addQuery(const QUrl url,const QString key,const QString value); protected: void getInstanceInfomation();