mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
Only update necessary sub-dirs
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
c74818464e
commit
6af4c3c397
4 changed files with 8 additions and 5 deletions
|
@ -115,7 +115,7 @@ class OfflineOperationsWorker(
|
|||
Log_OC.d(TAG, "$logMessage path: ${operation.path}, type: ${operation.type}")
|
||||
|
||||
if (result.isSuccess) {
|
||||
repository.updateNextOperations()
|
||||
repository.updateNextOperations(operation)
|
||||
fileDataStorageManager.offlineOperationDao.delete(operation)
|
||||
notificationManager.update(operations.size, currentOperationIndex, operation.filename ?: "")
|
||||
} else {
|
||||
|
|
|
@ -61,8 +61,11 @@ class OfflineOperationsRepository(
|
|||
fileDataStorageManager.removeFile(file, true, true)
|
||||
}
|
||||
|
||||
override fun updateNextOperations() {
|
||||
dao.getAll()
|
||||
override fun updateNextOperations(operation: OfflineOperationEntity) {
|
||||
val ocFile = fileDataStorageManager.getFileByDecryptedRemotePath(operation.path)
|
||||
val fileId = ocFile?.fileId ?: return
|
||||
|
||||
getAllSubdirectories(fileId)
|
||||
.mapNotNull { nextOperation ->
|
||||
nextOperation.parentOCFileId?.let { parentId ->
|
||||
fileDataStorageManager.getFileById(parentId)?.let { ocFile ->
|
||||
|
|
|
@ -13,5 +13,5 @@ import com.owncloud.android.datamodel.OCFile
|
|||
interface OfflineOperationsRepositoryType {
|
||||
fun getAllSubdirectories(fileId: Long): List<OfflineOperationEntity>
|
||||
fun deleteOperation(file: OCFile)
|
||||
fun updateNextOperations()
|
||||
fun updateNextOperations(operation: OfflineOperationEntity)
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ public class FileDataStorageManager {
|
|||
String newFolderName = oldFileName + " - " + currentDateTime;
|
||||
String newPath = parentFolder.getDecryptedRemotePath() + newFolderName + OCFile.PATH_SEPARATOR;
|
||||
moveLocalFile(file, newPath, parentFolder.getDecryptedRemotePath());
|
||||
offlineOperationsRepository.updateNextOperations();
|
||||
offlineOperationsRepository.updateNextOperations(entity);
|
||||
}
|
||||
|
||||
private @Nullable
|
||||
|
|
Loading…
Reference in a new issue