|
@@ -33,6 +33,7 @@ import org.apache.http.HttpStatus;
|
|
|
import android.accounts.Account;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.util.Log;
|
|
|
//import android.support.v4.content.LocalBroadcastManager;
|
|
|
|
|
|
import com.owncloud.android.datamodel.FileDataStorageManager;
|
|
@@ -323,9 +324,11 @@ public class SynchronizeFolderOperation extends RemoteOperation {
|
|
|
* @return 'True' when any change was made in the local data, 'false' otherwise
|
|
|
*/
|
|
|
private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
|
|
|
+ Vector<OCFile> mImageFiles = mStorageManager.getFolderImages(mLocalFolder);
|
|
|
+
|
|
|
// get 'fresh data' from the database
|
|
|
mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
|
|
|
-
|
|
|
+
|
|
|
// parse data from remote folder
|
|
|
OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
|
|
|
remoteFolder.setParentId(mLocalFolder.getParentId());
|
|
@@ -372,6 +375,15 @@ public class SynchronizeFolderOperation extends RemoteOperation {
|
|
|
if (remoteFile.isFolder()) {
|
|
|
remoteFile.setFileLength(localFile.getFileLength());
|
|
|
// TODO move operations about size of folders to FileContentProvider
|
|
|
+ } else if (mRemoteFolderChanged && remoteFile.isImage()) {
|
|
|
+ // If image has been updated on the server, set for updating the thumbnail
|
|
|
+ for (OCFile fileImage: mImageFiles) {
|
|
|
+ if (remoteFile.getRemoteId().equals(fileImage.getRemoteId()) &&
|
|
|
+ remoteFile.getModificationTimestamp() > fileImage.getModificationTimestamp()) {
|
|
|
+ remoteFile.setNeedsUpdateThumbnail(true);
|
|
|
+ Log.d(TAG, "Image " + remoteFile.getFileName() + " updated on the server");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
remoteFile.setPublicLink(localFile.getPublicLink());
|
|
|
remoteFile.setShareByLink(localFile.isShareByLink());
|