`Info::infohash` will discard fields not present in the `Info` struct,
and can thus produce an erronous infohash.
To try to prevent this function from being called in those
circumstances, rename it to `Info::infohash_lossy`, and add a comment
explaining why it is dangerous.
Embarassingly, `Info::infohash` was called in
`TorrentSummary::from_input`, and thus transitively by the torrent show
subcommand, where it is definitely not safe, since torrent show is
intended to be used with arbitrary torrents. This is now fixed.
There was also a build failure caused by a cache issue, so change the
cache keys to invalidate the caches.
type: fixed
- Combine test Metainfo values into a small number of globally available
values.
- Serialize update URLs as `URL` insted of `String`.
- Add additional `show` tests
type: reform
Add the `Invariant` trait, which provides `Invariant::invariant` and
`Invariant::invariant_unwrap` methods, and use them instead of unwrap
and expect.
I think these methods are a bit clearer than `unwrap` and `expect`,
since they more clearly document intent, i.e. that the thing passed to
`invariant` should be a description of an invariant that should always
be true, and should provide better error messages.
Replace uses of `unwrap` and `expect` with `invariant`.
type: reform
fixes:
- https://github.com/casey/intermodal/issues/167
- Use lowercase table names when priting to terminal
- Use `Creation Date` instead of `Created`, to make it
distinct from the `Created` field
type: changed
The --dht-node flag can be used to add DHT bootstrap nodes to new torrents.
This is the only piece of metainfo-related functionality in BEP 5, so we can mark BEP
5 as implemented.
type: added
Adds the command `imdl` torrent verify` to verify the contents of torrents.
This implementation is extremely naive. It does successfully verify torrents,
but it will produce unsatisfying results when a torrent fails verification. In
particular, it won't give any information about which pieces in a file were
corrupt.
type: added
Display the contents of torrents as tree of files when showing torrents
with `imdl torrent show` and after `imdl torrent create`.
The formatting and structure of the code was lifted entirely from torf.
type: added
Support adding a `source` key under the `info` dictionary. The `source`
key is commonly used to create distinct torrents for different trackers.
type: added
The `imdl torrent show` command displays information about on-disk
torrent files. The formatting of the command's output is copied from
torf, an excellent command-line torrent creator, editor, and viewer.
type: added