cmd/torrent: Include download stats on interrupt

This commit is contained in:
Matt Joiner 2021-09-20 21:33:46 +10:00
parent 63b3d2d211
commit 40b0f9ca1e
1 changed files with 2 additions and 2 deletions

View File

@ -359,7 +359,7 @@ func downloadErr(flags downloadFlags) error {
if client.WaitAll() {
log.Print("downloaded ALL the torrents")
} else {
return errors.New("y u no complete torrents?!")
err = errors.New("y u no complete torrents?!")
}
if flags.Seed {
if len(client.Torrents()) == 0 {
@ -378,7 +378,7 @@ func downloadErr(flags downloadFlags) error {
humanize.Bytes(uint64(clStats.BytesRead.Int64())),
100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()),
humanize.Bytes(uint64(sentOverhead)))
return nil
return err
}
func outputStats(cl *torrent.Client, args downloadFlags) {