projects
/
btrtrc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1272275
)
fix: added announce to torrent spec
author
Kupai József <jozsef.kupai@nokia.com>
Sat, 10 Oct 2015 12:31:02 +0000 (14:31 +0200)
committer
Kupai József <jozsef.kupai@nokia.com>
Sat, 10 Oct 2015 12:31:02 +0000 (14:31 +0200)
client.go
patch
|
blob
|
history
diff --git
a/client.go
b/client.go
index 5773627382ff5fb4596161a8f4e903f84532d651..a513930739ebfd56878596ea212b88b87b72007f 100644
(file)
--- a/
client.go
+++ b/
client.go
@@
-2140,6
+2140,13
@@
func TorrentSpecFromMetaInfo(mi *metainfo.MetaInfo) (spec *TorrentSpec) {
Info: &mi.Info,
DisplayName: mi.Info.Name,
}
+
+ if len(spec.Trackers) == 0 {
+ spec.Trackers = [][]string{[]string{mi.Announce}}
+ } else {
+ spec.Trackers[0] = append(spec.Trackers[0], mi.Announce)
+ }
+
CopyExact(&spec.InfoHash, &mi.Info.Hash)
return
}