Skip to content

Improve large file download#17169

Open
alperozturk96 wants to merge 7 commits into
masterfrom
determine-download-file-operation-session-time-out-based-on-file-size
Open

Improve large file download#17169
alperozturk96 wants to merge 7 commits into
masterfrom
determine-download-file-operation-session-time-out-based-on-file-size

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

Changes

  • Fixes empty notification
  • Fixes progress bar
  • Adds file size and uses session time out based on that

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
MockKAnnotations.init(this)
every { mockFileUploaderBinder.isUploading(any(), any()) } returns false
every { mockComponentsGetter.fileUploaderHelper } returns mockFileUploaderBinder
every { mockFileDownloadProgressListener.isDownloading(any(), any()) } returns false

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDownloading left over from foreground services no need this since worker is used

@Suppress("MagicNumber")
fun prepareForStart(operation: DownloadFileOperation) {
currentOperationTitle = File(operation.savePath).name
currentOperationTitle = operation.file.fileName

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses file name

@Suppress("MagicNumber")
fun updateDownloadProgress(percent: Int, totalToTransfer: Long) {
// If downloads are so fast, no need to notify again.
if (percent == lastPercent) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already outer call have this

private suspend fun trySetForeground(filename: String) {
try {
val foregroundInfo = createWorkerForegroundInfo()
val foregroundInfo = createWorkerForegroundInfo(filename)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes empty notification

@alperozturk96

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.0.x

@github-actions

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3333
Correctness6767
Dodgy code215215
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3131
Performance4141
Security1616
Total413413

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/27345115706/artifacts/7569119183
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

While downloading very big files, Error after 2 minuts (120 seconds) only on Android client

1 participant