Commit f4ba7a36 authored by chriadam's avatar chriadam

[buteo-sync-plugins-social] Remove deprecated media_info usage. Contributes to JB#46090

Dropbox has deprecated media_info in list_folder requests.
This commit removes our usage of media_info from list_folder requests,
and replaces the image width/height metadata we store with placeholder
values.  Those are eventually exposed (by libsocialcache) as
photoWidth/photoHeight to QML, but are not currently used.
parent dcbd28db
......@@ -152,7 +152,6 @@ void DropboxBackupSyncAdaptor::requestList(int accountId,
if (continuationCursor.isEmpty()) {
requestParameters.insert("path", remotePath);
requestParameters.insert("recursive", false);
requestParameters.insert("include_media_info", true);
requestParameters.insert("include_deleted", false);
requestParameters.insert("include_has_explicit_shared_members", false);
} else {
......
......@@ -227,7 +227,6 @@ void DropboxImageSyncAdaptor::queryCameraRoll(int accountId, const QString &acce
QJsonObject requestParameters;
if (continuationCursor.isEmpty()) {
requestParameters.insert("path", "/Pictures");
requestParameters.insert("include_media_info", true);
requestParameters.insert("include_deleted", false);
requestParameters.insert("include_has_explicit_shared_members", false);
} else {
......@@ -284,8 +283,6 @@ void DropboxImageSyncAdaptor::cameraRollFinishedHandler()
reply->deleteLater();
removeReplyTimeout(accountId, reply);
qWarning() << "Got replyData:" << replyData;
bool ok = false;
QJsonObject parsed = parseJsonObjectReplyData(replyData, &ok);
......@@ -332,12 +329,14 @@ qWarning() << "Got replyData:" << replyData;
const QString &remoteFilePath = fileObject.value("path_display").toString();
QString photoId = fileObject.value(QLatin1String("rev")).toString();
QString photoName = remoteFilePath.split("/").last();
int imageWidth = fileObject.value(QLatin1String("media_info")).toObject().value(QLatin1String("dimensions")).toObject().value(QLatin1String("width")).toInt();
int imageHeight = fileObject.value(QLatin1String("media_info")).toObject().value(QLatin1String("dimensions")).toObject().value(QLatin1String("height")).toInt();
if (imageWidth == 0 || imageHeight == 0) {
imageWidth = 768;
imageHeight = 1024;
}
// Previously, we retrieved imageWidth and imageHeight via the media_info.
// Dropbox have deprecated that, so now the only way to get the information
// is via per-file get_metadata requests, which are prohibitively expensive.
// Instead, just define these placeholder values, as it turns out that the
// values are never used in practice.
int imageWidth = 1024;
int imageHeight = 768;
QString createdTimeStr = fileObject.value(QLatin1String("client_modified")).toString();
QDateTime createdTime = QDateTime::fromString(createdTimeStr, Qt::ISODate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment