From: Matt Joiner Date: Sun, 22 May 2016 13:43:55 +0000 (+1000) Subject: Don't create an empty tracker URL if both AnnounceList and Announce are empty X-Git-Tag: v1.0.0~706 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=7a60873ec86fd0fb5f345370f71e38649db1ee02;p=btrtrc.git Don't create an empty tracker URL if both AnnounceList and Announce are empty --- diff --git a/client.go b/client.go index 5af08dcd..2b6c4da9 100644 --- a/client.go +++ b/client.go @@ -1489,10 +1489,8 @@ func TorrentSpecFromMetaInfo(mi *metainfo.MetaInfo) (spec *TorrentSpec) { DisplayName: mi.Info.Name, InfoHash: mi.Info.Hash(), } - if len(spec.Trackers) == 0 { - spec.Trackers = [][]string{[]string{mi.Announce}} - } else { - spec.Trackers[0] = append(spec.Trackers[0], mi.Announce) + if spec.Trackers == nil && mi.Announce != "" { + spec.Trackers = [][]string{{mi.Announce}} } return }