Commit Graph

104 Commits

Author SHA1 Message Date
Matt Joiner e417c19a74 Add "no name" handling and storage.NewFileOpts
This came out of testing against Transmission in https://github.com/anacrolix/torrent/discussions/556#discussioncomment-1263670.
2021-09-02 10:22:32 +10:00
Matt Joiner aa3b864426 Fix info name when building from . and .. 2021-09-02 10:22:32 +10:00
Matt Joiner 3b62b0054d Fix go:build directives 2021-07-14 14:35:52 +10:00
Matt Joiner c3c982b621 Fixes for wasm 2021-06-23 17:24:50 +10:00
Matt Joiner 615ac41ae3 Fix DeepSource anti-pattern 2021-03-25 09:56:04 +11:00
Matt Joiner 80cfe96c8b Make tracker order in Metainfo.Magnet deterministic
Should fix test failures in CI.
2021-03-25 09:51:49 +11:00
Matt Joiner a22c1334c6 Include webseed urls in MetaInfo.Magnet output
Fixes #469.
2021-02-24 12:11:47 +11:00
Matt Joiner 35464677ef Improve metainfo.MetaInfo.Magnet interface and add tests 2021-02-24 12:11:47 +11:00
Matt Joiner 434dfdf6e0 Add MarkComplete benchmark for sqlite 2021-01-25 15:54:37 +11:00
Matt Joiner 03b1abafb9 Implement encoding.TextMarshaler to match unmarshaler for metainfo.Hash
Fixes https://github.com/anacrolix/torrent/issues/463
2021-01-22 09:53:53 +11:00
Matt Joiner 1e9d382af9 Reinstate cmd/announce announce subcommand 2021-01-04 13:37:44 +11:00
Matt Joiner 0013035c93 Add deprecated ParseMagnetURI 2020-12-21 10:16:08 +11:00
Aranjedeath 8d27c02962 Update metainfo.go
delete "yoloham" so that is no longer the default comment string on torrents made without a comment specified. Should resolve https://github.com/anacrolix/torrent/issues/342
2020-12-10 10:12:33 +11:00
Matt Joiner 493ee9dfd1 Implement fmt.Formatter for metainfo.Hash
It's so easy to make mistakes by specifying %x when printing these.
2020-11-11 15:31:55 +11:00
Matt Joiner e6da640bb2 Tidy up doc, file names, naming 2020-11-09 10:56:45 +11:00
Matt Joiner 587f28d2fa Add comment to metainfo.MetaInfo.CreationDate 2020-05-13 14:33:26 +10:00
Matt Joiner ccc71463b9 Expose metainfo.GeneratePieces 2020-05-13 14:33:26 +10:00
Yaroslav Kolomiiets b4e10e00a9 add BEP references to documentation of the metadata fields 2020-05-03 14:06:24 +10:00
Matt Joiner 92162295af Clone the AnnounceList out of Torrent.Metainfo
Should fix a race with Torrent.AddTrackers
2020-04-15 17:26:02 +10:00
Matt Joiner 376ff763fe Apply staticcheck 2020-02-20 11:09:57 +11:00
Yates 790ba6af3c use path.utf8 first for some torrent (#350) 2019-12-08 20:35:40 +11:00
Matt Joiner f0843c30d0 Add comments to metainfo.Magnet fields 2019-09-24 16:29:29 +10:00
Matt Joiner 584cdbdc60 metainfo.Magnet.String: Always put xt first again, and with specific encoding 2019-09-24 16:29:17 +10:00
Matt Joiner 81ba0df9ed metainfo: Add Magnet.Params for more open handling
Addresses #310.
2019-09-24 15:52:18 +10:00
Matt Joiner 739fb68095 Update the magnet tests
These must have been very old, the style is appalling.
2019-09-24 15:51:08 +10:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner dfcb852487 gofmt simplify 2019-08-19 12:15:54 +10:00
Matt Joiner f16bea62a1 metainfo: Add fuzzing func 2019-08-18 16:51:20 +10:00
Matt Joiner a0d0c64e4f metainfo: Fix test
[]byte(nil) now correctly bencodes to a string
2018-11-27 11:05:32 +11:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00
Matt Joiner f5bd377941 Change pieceIndex to peer_protocol.Integer 2018-07-12 09:15:15 +10:00
Matt Joiner d7225aed03 Fix #247 2018-04-13 17:07:19 +10:00
Matt Joiner 1f3eace72f bencode: Add ignore_unmarshal_type_error tag 2018-01-27 14:31:46 +11:00
Matt Joiner 0e32592f78 bencode: Give more descriptive errors when failing to parse dicts 2018-01-25 21:46:50 +11:00
Matt Joiner a0172f7c6e Update error message in metainfo.Info.writeFiles
I think it was ripped out of some other code a long time ago.
2017-12-29 12:18:55 +11:00
Matt Joiner 5ac3e9ae54 Introduce metainfo.HashSize
This will be useful when BitTorrent 2 is implemented, and helps with creating arbitrary Info.Pieces
2017-12-29 12:17:58 +11:00
Matt Joiner 8195e8df7b Improve some doc comments 2017-12-29 12:16:05 +11:00
Matt Joiner da9cbc7cf0 metainfo: Omit empty Metainfo.InfoBytes 2017-11-08 19:57:05 +11:00
Matt Joiner 17ea4f7fdd Performance optimizations to calculating bytes left in Torrent
Was generating significant overhead in cmd/torrent
2017-09-23 15:28:13 +10:00
Matt Joiner cc17c8a54c metainfo URL list can be a string or list 2017-06-16 17:07:30 +10:00
Matt Joiner 6ca3275752 metainfo: Improve MetaInfo.AnnounceList handling 2017-02-15 20:05:28 +11:00
Matt Joiner a959bdd0f8 Revert "Quick fix for missing MetaInfo.Announce everywhere with trackers"
This reverts commit b7a8d08bbf.
2017-02-15 18:40:30 +11:00
Matt Joiner b7a8d08bbf Quick fix for missing MetaInfo.Announce everywhere with trackers 2017-02-13 22:28:42 +11:00
Matt Joiner 79d800fe92 Trivial logging, comment, Stringer changes 2017-02-02 16:53:19 +11:00
Matt Joiner c66c4d1744 Change type of metainfo.Info.URLList 2017-01-18 12:10:13 +11:00
Matt Joiner 902e40dd67 TODO 2017-01-18 12:09:51 +11:00
Matt Joiner 03227bf461 metainfo: FileInfo.Offset failed with single-file torrents 2017-01-04 18:09:17 +11:00
Matt Joiner 51bae0a3c8 metainfo: Add helper methods to FileInfo 2017-01-04 17:15:11 +11:00
Matt Joiner 65295eb513 Panic if NewHashFromHex gets a bad string 2017-01-01 10:08:45 +11:00
Barsanuphe 86c5b20e3f Added optional source flag to torrent files (#137) 2016-12-09 13:16:56 +11:00