GH-1864 fix imgur album creation

This commit is contained in:
Petr Mrázek 2017-05-04 22:58:22 +02:00
parent 35836c7709
commit 0ce44dbd41
3 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -14,6 +14,7 @@ struct ScreenShot
QFileInfo m_file;
QString m_url;
QString m_imgurId;
QString m_imgurDeleteHash;
};
typedef std::shared_ptr<ScreenShot> ScreenshotPtr;