novoda / download-manager

A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures
Apache License 2.0
483 stars 63 forks source link

Enforce filename uniqueness #517

Open ouchadam opened 5 years ago

ouchadam commented 5 years ago

It's possible to encounter misleading file mismatch errors when the same file names are used as the library will unknowingly append to already downloaded files.

batch_id_1 has a greater current size: 21568 than the total size: 21568 

I encountered this issue when using the default naming with urls that end with the same path and each file has a unique ID

https://foo.bar/1/abc.mp3
https://foo.bar/2/abc.mp3

Currently the library forces IDs to be unique, perhaps filenames should be checked as well?