Fix for e2e

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-04-01 12:36:25 +02:00 committed by Alper Öztürk
parent 057387a720
commit ef9c088761
2 changed files with 5 additions and 6 deletions

View File

@ -49,12 +49,11 @@ class FileDownloadHelper {
val fileStorageManager = FileDataStorageManager(user, MainApp.getAppContext().contentResolver)
val topParentId = fileStorageManager.getTopParentId(file)
return if (file.isFolder) {
backgroundJobManager.isStartFileDownloadJobScheduled(user, file.fileId) ||
backgroundJobManager.isStartFileDownloadJobScheduled(user, topParentId)
val isJobScheduled = backgroundJobManager.isStartFileDownloadJobScheduled(user, file.fileId)
return isJobScheduled || if (file.isFolder) {
backgroundJobManager.isStartFileDownloadJobScheduled(user, topParentId)
} else {
backgroundJobManager.isStartFileDownloadJobScheduled(user, file.fileId) ||
FileDownloadWorker.isDownloading(user.accountName, file.fileId)
FileDownloadWorker.isDownloading(user.accountName, file.fileId)
}
}

View File

@ -273,7 +273,7 @@ public class DownloadFileOperation extends RemoteOperation {
}
}
if (downloadType == DownloadType.DOWNLOAD) {
if (downloadType == DownloadType.DOWNLOAD && !file.isEncrypted()) {
moved = tmpFile.renameTo(newFile);
newFile.setLastModified(file.getModificationTimestamp());
if (!moved) {