From: Matt Joiner Date: Wed, 1 Sep 2021 05:26:12 +0000 (+1000) Subject: cmd/torrent download: Don't seed if no torrents are specified X-Git-Tag: v1.31.0~4 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=62911fd65632ccca521ed9108d8ecd27be0780f3;p=btrtrc.git cmd/torrent download: Don't seed if no torrents are specified --- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 61fd2ab2..a11373f7 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -355,8 +355,12 @@ func downloadErr() error { return xerrors.New("y u no complete torrents?!") } if flags.Seed { - outputStats(client) - <-stop.C() + if len(client.Torrents()) == 0 { + log.Print("no torrents to seed") + } else { + outputStats(client) + <-stop.C() + } } return nil }