summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-04 22:58:22 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-04 22:58:22 +0200
commit0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3 (patch)
treed2dea35636db191137dfb60bdc3a941241e2a819 /api/logic
parent35836c7709fec86f1e005528482f7b22fd07c935 (diff)
downloadMultiMC-0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3.tar
MultiMC-0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3.tar.gz
MultiMC-0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3.tar.lz
MultiMC-0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3.tar.xz
MultiMC-0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3.zip
GH-1864 fix imgur album creation
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/screenshots/ImgurAlbumCreation.cpp6
-rw-r--r--api/logic/screenshots/ImgurUpload.cpp1
-rw-r--r--api/logic/screenshots/Screenshot.h1
3 files changed, 5 insertions, 3 deletions
diff --git a/api/logic/screenshots/ImgurAlbumCreation.cpp b/api/logic/screenshots/ImgurAlbumCreation.cpp
index a6964681..3724e3df 100644
--- a/api/logic/screenshots/ImgurAlbumCreation.cpp
+++ b/api/logic/screenshots/ImgurAlbumCreation.cpp
@@ -25,13 +25,13 @@ void ImgurAlbumCreation::start()
request.setRawHeader("Authorization", "Client-ID 5b97b0713fba4a3");
request.setRawHeader("Accept", "application/json");
- QStringList ids;
+ QStringList hashes;
for (auto shot : m_screenshots)
{
- ids.append(shot->m_imgurId);
+ hashes.append(shot->m_imgurDeleteHash);
}
- const QByteArray data = "ids=" + ids.join(',').toUtf8() + "&title=Minecraft%20Screenshots&privacy=hidden";
+ const QByteArray data = "deletehashes=" + hashes.join(',').toUtf8() + "&title=Minecraft%20Screenshots&privacy=hidden";
QNetworkReply *rep = ENV.qnam().post(request, data);
diff --git a/api/logic/screenshots/ImgurUpload.cpp b/api/logic/screenshots/ImgurUpload.cpp
index ef7fee6b..659879f6 100644
--- a/api/logic/screenshots/ImgurUpload.cpp
+++ b/api/logic/screenshots/ImgurUpload.cpp
@@ -100,6 +100,7 @@ void ImgurUpload::downloadFinished()
}
m_shot->m_imgurId = object.value("data").toObject().value("id").toString();
m_shot->m_url = object.value("data").toObject().value("link").toString();
+ m_shot->m_imgurDeleteHash = object.value("data").toObject().value("deletehash").toString();
m_status = Job_Finished;
finished = true;
emit succeeded(m_index_within_job);
diff --git a/api/logic/screenshots/Screenshot.h b/api/logic/screenshots/Screenshot.h
index b48cbe99..2c70ecf5 100644
--- a/api/logic/screenshots/Screenshot.h
+++ b/api/logic/screenshots/Screenshot.h
@@ -14,6 +14,7 @@ struct ScreenShot
QFileInfo m_file;
QString m_url;
QString m_imgurId;
+ QString m_imgurDeleteHash;
};
typedef std::shared_ptr<ScreenShot> ScreenshotPtr;