]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent download: Don't seed if no torrents are specified
authorMatt Joiner <anacrolix@gmail.com>
Wed, 1 Sep 2021 05:26:12 +0000 (15:26 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 2 Sep 2021 00:22:32 +0000 (10:22 +1000)
cmd/torrent/main.go

index 61fd2ab2791cafc5ec80d2f5249181b02fe82f5e..a11373f7bb5326a041686b2a223d6bd439a9d0e3 100644 (file)
@@ -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
 }