Add Announce when AnnounceList is nil

This commit is contained in:
Ye Yin 2016-07-22 15:16:11 +08:00
parent 1e8c6808b2
commit 6a2137f2b6
1 changed files with 3 additions and 0 deletions

View File

@ -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