From 0810d5a2752d49aba4ba25a1812115a65f753fbb Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 30 Dec 2014 23:58:38 +1100 Subject: [PATCH] Helper method on Client's Torrent that tells where the metainfo file would be stored --- client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client.go b/client.go index c11d1a02..0ddf41f7 100644 --- a/client.go +++ b/client.go @@ -1157,6 +1157,8 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error { for r := range c.Requests { me.connDeleteRequest(t, c, r) } + // We can then reset our interest. + me.replenishConnRequests(t, c) case pp.Unchoke: c.PeerChoked = false me.peerUnchoked(t, c) @@ -1621,6 +1623,10 @@ type Torrent struct { *torrent } +func (t Torrent) MetainfoFilepath() string { + return filepath.Join(t.cl.ConfigDir(), "torrents", t.InfoHash.HexString()+".torrent") +} + func (t Torrent) AddPeers(pp []Peer) error { return t.cl.AddPeers(t.torrent.InfoHash, pp) } -- 2.48.1