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
Currently, it is only possible to pass a custom progress bar with
ApiRepo::download_with_progress, I would like to suggest adding this feature toApiRepo::getby adding a similar variant, for example,ApiRepo::get_with_progresswhich directly callsdownload_with_progresswith the custom progress bar.Justification
getchecks whether the requested file exists locally in the cache before downloading, whiledownload_with_progressdoes not. It would be great if we can have both the local cache check and a custom progress bar.Alternative
Create a
Cacheinstance manually and copy whatgetdoes. This works but seems a bit redundant asApiRepoitself already has aCacheinstance, especially when there are custom configs added to theCachewith 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