Commit 2cf1ffc5 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

reorganise run code of listFileRemoteOperation

parent 6de07962
Pipeline #20869 passed with stage
in 2 minutes and 22 seconds
......@@ -64,16 +64,20 @@ public class ListFileRemoteOperation extends RemoteOperation {
//Get CurrentSyncedFolder
SyncedFolder syncedFolder = mSyncedFolderIterator.next();
if(syncedFolder.isScanRemote()) {
//If folder isn't to be scan remotly, ignore it
if(!syncedFolder.isScanRemote()) continue;
if(syncedFolder.getId() == -1) {
//persist new syncedFolder
int syncedFolderId = (int) DbHelper.insertSyncedFolder(syncedFolder, mContext);
if (syncedFolderId > 0) {
syncedFolder.setId(syncedFolderId);
}else{
mSyncedFolderIterator.remove();
Log.w(TAG, "syncedFolder "+syncedFolder.getRemoteFolder()+" doesn't have a valid ID");
}
}
if(syncedFolder.getId() > 0){
//Create ReadRemoteOperation
LightReadFolderRemoteOperation operation = new LightReadFolderRemoteOperation(syncedFolder.getRemoteFolder(), DEPTH_1, false);
RemoteOperationResult result = operation.execute(ownCloudClient);
......@@ -139,11 +143,7 @@ public class ListFileRemoteOperation extends RemoteOperation {
}
Log.w(TAG, "LightReadFolderRemoteOperation failed : http " + result.getHttpCode() + ", " + result.getLogMessage()+" => Ignored");
}
}else{
mSyncedFolderIterator.remove();
Log.w(TAG, "syncedFolder "+syncedFolder.getRemoteFolder()+" doesn't have a valid ID");
}
} //Then its folder is not scanRemote
} //End of loop
finalResult = new RemoteOperationResult(RemoteOperationResult.ResultCode.OK);
......
Supports Markdown
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