From 6a2137f2b63a963051fcb852b96837c85bbfd13e Mon Sep 17 00:00:00 2001 From: Ye Yin Date: Fri, 22 Jul 2016 15:16:11 +0800 Subject: [PATCH] Add Announce when AnnounceList is nil --- metainfo/metainfo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metainfo/metainfo.go b/metainfo/metainfo.go index f50190eb..b9a65a9d 100644 --- a/metainfo/metainfo.go +++ b/metainfo/metainfo.go @@ -213,6 +213,9 @@ func (mi *MetaInfo) Magnet() (m Magnet) { m.Trackers = append(m.Trackers, tracker) } } + if m.Trackers == nil && mi.Announce != "" { + m.Trackers = []string{mi.Announce} + } m.DisplayName = mi.Info.Name m.InfoHash = mi.Info.Hash() return