aria2p icon indicating copy to clipboard operation
aria2p copied to clipboard

Retry download not continue download

Open Monirzadeh opened this issue 2 years ago • 2 comments

Describe the bug if you download a link (has some progress for example 50%) than get error or failed retry them with r or R than aria2p save them as 100% and complete instead of continue download them To Reproduce Steps to reproduce the behavior:

  1. add a link to aria2p
  2. wait for some progress.
  3. disconnect from internet or wait for a failed error.
  4. connect internet
  5. press R or r to retry download
  6. as you see set that error downoad change to complete instead of active to continue downloading

Expected behavior if a file get failed or error, retry continue downloading instead of save them as complete.

System (please complete the following information):

  • aria2p version: [0.11.2]
  • Python version: [3.10.5]
  • OS: [Linux]

Additional context if I restart that download with other client for example motrix than it is correctly continue download

Monirzadeh avatar Jun 30 '22 12:06 Monirzadeh

Hello, thanks for the report. I will try to replicate but I suspect I won't be able to fix it if it comes from aria2 itself.

pawamoy avatar Aug 17 '22 18:08 pawamoy

Do you want any specific test on my side?

Monirzadeh avatar Aug 18 '22 10:08 Monirzadeh

It may be a bug in file api.py line 421.

self.remove([download], clean)

the function "remove" is in line 426

def remove(  # noqa: WPS231 (complex, maybe we could split it)
    self,
    downloads: List[Download],
    force: bool = False,
    files: bool = False,
    clean: bool = True,
) -> List[OperationResult]:

the parameter of "clean" in line 421 is the parameter "force" in line 426. It will make clean=True in line 421 and delete the .aria2 files accidently. Then, when you retry the download, it will be complete at once instead of continue downloading them. The right line 421 may like this

self.remove([download], clean=clean)

Links662 avatar Oct 24 '22 12:10 Links662

Wow, good catch @Links662! That's an argument in favor of keyword-only parameters! Let me fix that right now. And thank you for your patience!

pawamoy avatar Dec 15 '22 19:12 pawamoy