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

Using MoveFileAsync causes FullPath to be neither DownloadIncompleteFullPath nor DownloadCompleteFullPath #606

Closed
ManlyMarco opened this issue Jan 24, 2023 · 2 comments · Fixed by #608

Comments

@ManlyMarco
Copy link

ManlyMarco commented Jan 24, 2023

Using MoveFileAsync to move a torrent file changes its ITorrentManagerFile.FullPath, but not DownloadIncompleteFullPath nor DownloadCompleteFullPath. After the download finishes, the file is moved to DownloadCompleteFullPath while FullPath stays as whatever was used in MoveFileAsync

The documentation states: If the file is currently being downloaded, this will be the same as <see cref="DownloadIncompleteFullPath"/>. Otherwise it will be <see cref="DownloadCompleteFullPath"/>

The below is what I get after using MoveFileAsync to move the file to a temporary path, then waiting for the torrent to finish downloading and stopping it.

DownloadIncompleteFullPath=F:\.....\test.bin 
DownloadCompleteFullPath=F:\.....\test.bin 
FullPath=F:\temp\pk0h5mbi.mbu

Tested on 3.0.0-beta.rev0106

Edit: It looks like two copies of the file exist right at the end of a download, one in FullPath and one in DownloadCompleteFullPath.

@alanmcgovern
Copy link
Owner

Could you let me know if the changes in that branch ( #608 ) fix the issue for you?

There were tests ensuring the right thing happened when toggling UsePartialFiles on/off, but there were no tests ensuring things were in sync after MoveFilesAsync was invoked... and, well, that's why it flat out didn't work!

This tests those cases now, and it also ensures that the on-disk files are also in the correct place.

@ManlyMarco
Copy link
Author

The issue appears to be fixed in that branch, thanks!

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

Successfully merging a pull request may close this issue.

2 participants