Commit b1a1b558 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

cherry pick 006f82a2

parent 8cf12f0c
Pipeline #20904 passed with stage
in 1 minute and 53 seconds
...@@ -330,16 +330,23 @@ public class ObserverService extends Service implements OnRemoteOperationListene ...@@ -330,16 +330,23 @@ public class ObserverService extends Service implements OnRemoteOperationListene
ListIterator<SyncedFileState> syncedFileListIterator; ListIterator<SyncedFileState> syncedFileListIterator;
for( int i =-1, size = remoteFiles.size(); ++i < size; ){ for( int i =-1, size = remoteFiles.size(); ++i < size; ){
syncedFileListIterator = syncedFileStates.listIterator(); //reset listiterator syncedFileListIterator = syncedFileStates.listIterator(); //reset listiterator
boolean correspondant_found = false; boolean correspondant_found = false;
final RemoteFile remoteFile = (RemoteFile) remoteFiles.get(i); final RemoteFile remoteFile = (RemoteFile) remoteFiles.get(i);
final String remoteFilePath = remoteFile.getRemotePath(); final String remoteFilePath = remoteFile.getRemotePath();
Log.v( TAG, "start to loop through syncedFileListIterator for: "+remoteFilePath); Log.v( TAG, "start to loop through syncedFileListIterator for: "+remoteFilePath);
// hidden file from server has already been filtered in previous step
while( syncedFileListIterator.hasNext() && !correspondant_found ){ while( syncedFileListIterator.hasNext() && !correspondant_found ){
SyncedFileState syncedFileState = syncedFileListIterator.next(); SyncedFileState syncedFileState = syncedFileListIterator.next();
//ignore hidden file from db
if(syncedFileState.isMediaType() && syncedFileState.getName().startsWith(".")){
syncedFileListIterator.remove();
continue;
}
Log.d(TAG, "syncedFileState.getRemotePath() :"+syncedFileState.getRemotePath() ); Log.d(TAG, "syncedFileState.getRemotePath() :"+syncedFileState.getRemotePath() );
if( !mOperationManagerService.isSyncingFile( syncedFileState.getLocalPath() ) ) { if( !mOperationManagerService.isSyncingFile( syncedFileState.getLocalPath() ) ) {
...@@ -513,8 +520,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene ...@@ -513,8 +520,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene
while(iterator.hasNext() ){ while(iterator.hasNext() ){
SyncedFolder syncedFolder = iterator.next(); SyncedFolder syncedFolder = iterator.next();
Log.v(TAG, "SyncedFolder :"+syncedFolder.getLibelle()+", "+syncedFolder.getLocalFolder()+", "+syncedFolder.getLastModified()+", "+syncedFolder.isScanLocal()+", "+syncedFolder.getId() ); Log.v(TAG, "SyncedFolder :"+syncedFolder.getLibelle()+", "+syncedFolder.getLocalFolder()+", "+syncedFolder.getLastModified()+", "+syncedFolder.isScanLocal()+", "+syncedFolder.getId() );
if(syncedFolder.isMediaType() && CommonUtils.getFileNameFromPath(syncedFolder.getLocalFolder()).startsWith(".")){ if(syncedFolder.isMediaType() && CommonUtils.getFileNameFromPath(syncedFolder.getLocalFolder()).startsWith(".")){
...@@ -624,6 +629,13 @@ public class ObserverService extends Service implements OnRemoteOperationListene ...@@ -624,6 +629,13 @@ public class ObserverService extends Service implements OnRemoteOperationListene
while( syncedFileListIterator.hasNext() && !correspondant_found ) { while( syncedFileListIterator.hasNext() && !correspondant_found ) {
SyncedFileState syncedFileState = syncedFileListIterator.next(); SyncedFileState syncedFileState = syncedFileListIterator.next();
//Ignore hidden media file store in DB
if(syncedFileState.isMediaType() && syncedFileState.getName().startsWith(".")){
syncedFileListIterator.remove();
continue;
}
Log.v(TAG, syncedFileState.getLocalPath()+", "+syncedFileState.getId()+", "+syncedFileState.getLocalLastModified()); Log.v(TAG, syncedFileState.getLocalPath()+", "+syncedFileState.getId()+", "+syncedFileState.getLocalLastModified());
//Si le fichier n'est pas en train d'être synchronisé //Si le fichier n'est pas en train d'être synchronisé
if (mBoundToOperationManager && !mOperationManagerService.isSyncingFile( syncedFileState.getLocalPath() ) ){ //le fichier n'est pas actuellement en train d'être chargé if (mBoundToOperationManager && !mOperationManagerService.isSyncingFile( syncedFileState.getLocalPath() ) ){ //le fichier n'est pas actuellement en train d'être chargé
......
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