summaryrefslogtreecommitdiffstats
path: root/logic/net
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
commita8811a27f78698f1ab2acad47e90f3b16274e221 (patch)
tree4986fed4712433484597e4a63a022ee5c989c337 /logic/net
parent226c1bdae5ec615381965b6731f6496dffa3299e (diff)
downloadMultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.gz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.lz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.xz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.zip
Working screenshot upload
Diffstat (limited to 'logic/net')
-rw-r--r--logic/net/ScreenshotUploader.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/logic/net/ScreenshotUploader.cpp b/logic/net/ScreenshotUploader.cpp
index 829a0815..490c74b3 100644
--- a/logic/net/ScreenshotUploader.cpp
+++ b/logic/net/ScreenshotUploader.cpp
@@ -24,7 +24,6 @@ void ScreenShotUpload::start()
m_status = Job_InProgress;
QNetworkRequest request(m_url);
request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Uncached)");
- request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
request.setRawHeader("Authorization", "Client-ID 5b97b0713fba4a3");
request.setRawHeader("Accept", "application/json");
@@ -47,7 +46,7 @@ void ScreenShotUpload::start()
multipart->append(typePart);
QHttpPart namePart;
namePart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data; name=\"name\"");
- namePart.setBody(m_shot->timestamp.toUtf8());
+ namePart.setBody(m_shot->timestamp.toString(Qt::ISODate).toUtf8());
multipart->append(namePart);
auto worker = MMC->qnam();
@@ -85,8 +84,8 @@ void ScreenShotUpload::downloadFinished()
emit failed(m_index_within_job);
return;
}
- m_shot->imgurIndex = object.value("data").toObject().value("id").toVariant().toInt();
- m_shot->url = "https://imgur.com/gallery/" + QString::number(m_shot->imgurIndex);
+ m_shot->imgurIndex = object.value("data").toObject().value("id").toString();
+ m_shot->url = object.value("data").toObject().value("link").toString();
m_status = Job_Finished;
emit succeeded(m_index_within_job);
return;