[ControlFile] Make magent request from control file

pull/2179/head
Idan Geraffi 2024-02-18 16:33:52 +02:00
parent a5da420c01
commit 07676f7f9c
1 changed files with 4 additions and 2 deletions

View File

@ -70,6 +70,7 @@
// TODO ENABLE CONTROLFILE
#include "TorrentAttribute.h"
#include "bittorrent_helper.h"
#include "DefaultBtProgressInfoFile.h"
namespace aria2 {
@ -453,9 +454,10 @@ public:
else if (!ignoreLocalPath_ && detector_.guessAria2ControlFile(uri))
{
// Extract hash and construct a magnet to feed into createBtMagentRequestGroup
const auto infoHash = DefaultBtProgressInfoFile::getInfoHash(uri);
auto torrent_attribute = std::make_unique<const TorrentAttribute>();
// torrent_attribute->infoHash = the hash from the file
auto torrent_attribute = std::make_unique<TorrentAttribute>();
torrent_attribute->infoHash = std::string(std::begin(infoHash), std::end(infoHash));
const auto magent = aria2::bittorrent::torrent2Magnet(torrent_attribute.get());
requestGroups_.push_back(createBtMagnetRequestGroup(magent, option_));