mod update and fix build

This commit is contained in:
nikk gitanes
2022-01-20 09:43:05 +03:00
parent 460ea98563
commit 4898827fa5
7 changed files with 42 additions and 132 deletions

View File

@@ -24,8 +24,8 @@ func ParseFile(file multipart.File) (*torrent.TorrentSpec, error) {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
Trackers: [][]string{mag.Trackers},
@@ -106,8 +106,8 @@ func fromHttp(link string) (*torrent.TorrentSpec, error) {
if err != nil {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
@@ -130,8 +130,8 @@ func fromFile(path string) (*torrent.TorrentSpec, error) {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
Trackers: [][]string{mag.Trackers},

View File

@@ -28,8 +28,8 @@ func getTorrents(c *gin.Context) {
mi := metainfo.MetaInfo{
AnnounceList: ts.Trackers,
}
// mag := mi.Magnet(ts.DisplayName, ts.InfoHash)
mag := mi.Magnet(&ts.InfoHash, &metainfo.Info{Name: ts.DisplayName})
mag := mi.Magnet(ts.DisplayName, ts.InfoHash)
// mag := mi.Magnet(&ts.InfoHash, &metainfo.Info{Name: ts.DisplayName})
http += "<p><a href='" + mag.String() + "'>magnet:?xt=urn:btih:" + mag.InfoHash.HexString() + "</a></p>"
}
http += "</div>"