cmd/torrent: Include download stats on interrupt
This commit is contained in:
parent
63b3d2d211
commit
40b0f9ca1e
|
@ -359,7 +359,7 @@ func downloadErr(flags downloadFlags) error {
|
||||||
if client.WaitAll() {
|
if client.WaitAll() {
|
||||||
log.Print("downloaded ALL the torrents")
|
log.Print("downloaded ALL the torrents")
|
||||||
} else {
|
} else {
|
||||||
return errors.New("y u no complete torrents?!")
|
err = errors.New("y u no complete torrents?!")
|
||||||
}
|
}
|
||||||
if flags.Seed {
|
if flags.Seed {
|
||||||
if len(client.Torrents()) == 0 {
|
if len(client.Torrents()) == 0 {
|
||||||
|
@ -378,7 +378,7 @@ func downloadErr(flags downloadFlags) error {
|
||||||
humanize.Bytes(uint64(clStats.BytesRead.Int64())),
|
humanize.Bytes(uint64(clStats.BytesRead.Int64())),
|
||||||
100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()),
|
100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()),
|
||||||
humanize.Bytes(uint64(sentOverhead)))
|
humanize.Bytes(uint64(sentOverhead)))
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func outputStats(cl *torrent.Client, args downloadFlags) {
|
func outputStats(cl *torrent.Client, args downloadFlags) {
|
||||||
|
|
Loading…
Reference in New Issue