I know you said you're already working on the Rust port, but this should help in the meantime. This PR simply resets the file position to the start of the file before activating curl, which should prevent it from appending a correctly-downloaded file to a partial download.
I've tested it by starting a download of "Darts Up (US)," waiting until the status box says it's downloading 00000016.app, then pausing it and walking away for a minute. When resuming, it appears to stutter for a second, and then restart the file download from the beginning (as it did before,) but with this change, it doesn't corrupt the file when it does this.
I know you said you're already working on the Rust port, but this should help in the meantime. This PR simply resets the file position to the start of the file before activating curl, which should prevent it from appending a correctly-downloaded file to a partial download.
I've tested it by starting a download of "Darts Up (US)," waiting until the status box says it's downloading
00000016.app
, then pausing it and walking away for a minute. When resuming, it appears to stutter for a second, and then restart the file download from the beginning (as it did before,) but with this change, it doesn't corrupt the file when it does this.