animdl icon indicating copy to clipboard operation
animdl copied to clipboard

Download exit value incorrect

Open BogdanTheGeek opened this issue 3 years ago • 1 comments

Describe the bug

animdl download "One Piece" --range 2068 --index 2 returns 0 I would expect a 1 if a download cannot find a file to download or at least NO_CONTENT_FOUND as defined in /core/cli/exit_codes.py For people reading this in the future, latest episode is 1029

Did the error occur in between an active task (download / stream / grab)?

download

Screenshots [Optional]

Additional information

$ animdl download "One Piece" --range 2068 --index 2
                                     justfoolingaround/animdl - v1.6.21                                      
                            A highly efficient, powerful and fast anime scraper.  
$|

BogdanTheGeek avatar Aug 16 '22 22:08 BogdanTheGeek

From what I can see, this could be fixed by adding this:

    if total < 1:
        logger.error("No file found to download")
        raise SystemExit(exit_codes.NO_CONTENT_FOUND)

in core/cli/command/download.py:68

BogdanTheGeek avatar Aug 16 '22 22:08 BogdanTheGeek

Added as of 1.6.25. Thank you!

justfoolingaround avatar Nov 25 '22 16:11 justfoolingaround