Skip to content

[feat] Allow Custom Progress Bar for ApiRepo::get #135

@Kynson

Description

@Kynson

Currently, it is only possible to pass a custom progress bar with ApiRepo::download_with_progress, I would like to suggest adding this feature to ApiRepo::get by adding a similar variant, for example, ApiRepo::get_with_progress which directly calls download_with_progress with the custom progress bar.

Justification

get checks whether the requested file exists locally in the cache before downloading, while download_with_progress does not. It would be great if we can have both the local cache check and a custom progress bar.

Alternative

Create a Cache instance manually and copy what get does. This works but seems a bit redundant as ApiRepo itself already has a Cache instance, especially when there are custom configs added to the Cache with the api builder.

PS. I am happy to make a PR if the team found this is manageable to add this feature (I understand this is an internal crate, but since I used it personally, I would like to contribute)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions