/* */ #include "BtPostDownloadHandler.h" #include "DefaultBtContext.h" #include "prefs.h" #include "RequestGroup.h" #include "Option.h" #include "Logger.h" BtPostDownloadHandler::BtPostDownloadHandler(const Option* option): PostDownloadHandler(".torrent", option) {} BtPostDownloadHandler::~BtPostDownloadHandler() {} RequestGroups BtPostDownloadHandler::getNextRequestGroups(const string& path) { _logger->debug("Generating RequestGroups for Torrent file %s", path.c_str()); RequestGroupHandle rg = new RequestGroup(_option, Strings()); DefaultBtContextHandle btContext = new DefaultBtContext(); btContext->load(path); if(_option->defined(PREF_PEER_ID_PREFIX)) { btContext->setPeerIdPrefix(_option->get(PREF_PEER_ID_PREFIX)); } btContext->setDir(_option->get(PREF_DIR)); rg->setDownloadContext(btContext); btContext->setOwnerRequestGroup(rg.get()); RequestGroups groups; groups.push_back(rg); return groups; }