Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features: clearDb by status, downloaded bytes in DownloadModel, Concurrent Limit ... #33

Open
ultranity opened this issue Oct 6, 2024 · 1 comment

Comments

@ultranity
Copy link

Ketch have a nice kotlin style API and I do like it, but when trying I have found some missing features:

  • DB management
    As it's a common demand to clear all canceled/finished task.
    for now we can use like:
                    ketch.getAllDownloads().filter { it.status == Status.SUCCESS }.forEach {
                        ketch.clearDb(it.id, false)
                    }

It will be cool to support clearDb by status to simplify the usage.

  • DownloadModel info
    there are progress(maped in MapperUtil.kt) and totalBytes in DownloadModel, why not add also provide downloadedBytes?

  • Concurrency
    Ketch mentioned it supports:"download multiple files in parallel", is there any way to control the concurrency?
    As Ketch use worker manager to queue download tasks instead of customized task queue, how to control the Concurrency/max items to download in parallel?

@khushpanchal
Copy link
Owner

  1. I am planning to add support clearDb by status in future version. Feel free to create PR for this.
  2. I thought it is not required and won't give much advantage, also if can be anyways calculated from progress and total bytes
  3. Currently no way from outside to control concurrency. Currently max items are controlled by workmanager itself. Currently using CoroutineWorker that is controlling this as it is using Dispatches.Default. Will plan on it later. Feel free to create the PR for this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants