Commit graph

4 commits

Author SHA1 Message Date
King_DuckZ
d04b4d8274 Add a read_announce_list() to TorrentRead
announce-list is very annoyingly a list of lists. I don't
have any useful primitive to manage that case in TorrentRead,
so for now I've done a not-so-elegant implementation where I
step around the visitor, use my knowledge of the variant and
access the outer list directly through boost::get(). I'm not
necessarily convinced that this is bad since on the other hand
the solution consistent with the rest of the implementation
would involve searching for "/[[x]]/[[y]]" which has its own
overhead. I mean, variant contains a vector, I can access it
normally. Visitor is a convenience thing, I don't see why
parser's client code should be obliged to pretend the variant
cannot be accessed directly.
2025-04-07 02:39:35 +01:00
King_DuckZ
f7d90a789d Move hashes collection to TorrentRead
So yeah, while TorrentRead is not compulsory to use,
right now it'd be pretty inconvenient to not use it
as the hash grouping function is fidgety to get right.
I think group_torrent_hashes() eventually should be
moved elsewhere.
2025-04-07 01:30:04 +01:00
King_DuckZ
5aa42b5e43 Add some more read_ functions to TorrentRead 2025-04-07 01:27:59 +01:00
King_DuckZ
50f33300be Refactor higher level code into TorrentRead class
This also addresses the issue with paths of more than 1 item
so all torrents should now work and adds some error reporting
through exceptions
2025-04-07 01:01:52 +01:00