|
|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
#ifndef _TR_TORRENTS_HPP_ |
|
|
|
|
#define _TR_TORRENTS_HPP_ |
|
|
|
|
#include <boost/filesystem.hpp> |
|
|
|
|
#include <http.hpp> |
|
|
|
|
#include <libtorrent/magnet_uri.hpp> |
|
|
|
|
#include <util.hpp> |
|
|
|
|
#include <boost/filesystem.hpp> |
|
|
|
|
|
|
|
|
|
namespace tr { |
|
|
|
|
namespace session { |
|
|
|
|
@ -84,11 +84,6 @@ void post(settings opts, torrent_session &session, response resp, request req) {
|
|
|
|
|
} else |
|
|
|
|
params.save_path = boost::filesystem::path(opts.root_dir / opts.default_download_dir).string(); |
|
|
|
|
|
|
|
|
|
// if (request_object.find("paused") != request_object.end()) {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
session.async_add_torrent(params); |
|
|
|
|
|
|
|
|
|
std::stringstream ss; |
|
|
|
|
@ -96,10 +91,6 @@ void post(settings opts, torrent_session &session, response resp, request req) {
|
|
|
|
|
|
|
|
|
|
http_response.add_header({"Location", "/session/torrents/" + ss.str()}); |
|
|
|
|
return respond(http::created); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// session.async_add_torrent(params);
|
|
|
|
|
// http_response.add_header({"Location",params.info_hash.to_string()});
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|