torrent serve: Print magnet link
This commit is contained in:
parent
0158a830f5
commit
3c54eadf28
|
@ -65,7 +65,7 @@ func serve(ctx args.SubCmdCtx) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("setting trackers: %w", err)
|
||||
}
|
||||
fmt.Println(ih)
|
||||
fmt.Printf("%v: %v\n", to, to.Metainfo().Magnet(&ih, &info))
|
||||
select {}
|
||||
})
|
||||
return nil
|
||||
|
|
|
@ -69,7 +69,7 @@ func (mi *MetaInfo) SetDefaults() {
|
|||
}
|
||||
|
||||
// Creates a Magnet from a MetaInfo. Optional infohash and parsed info can be provided.
|
||||
func (mi *MetaInfo) Magnet(infoHash *Hash, info *Info) (m Magnet) {
|
||||
func (mi MetaInfo) Magnet(infoHash *Hash, info *Info) (m Magnet) {
|
||||
m.Trackers = append(m.Trackers, mi.UpvertedAnnounceList().DistinctValues()...)
|
||||
if info != nil {
|
||||
m.DisplayName = info.BestName()
|
||||
|
|
Loading…
Reference in New Issue