You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
#ifndef _TR_TEST_TORRENT_CONTEXT_HPP_ |
|
#define _TR_TEST_TORRENT_CONTEXT_HPP_ |
|
|
|
#include <json.hpp> |
|
#include <libtorrent/magnet_uri.hpp> |
|
#include <string> |
|
|
|
class TorrentStatus { |
|
public: |
|
bool paused = false; |
|
bool is_seeding = false; |
|
bool announcing_to_dht = true; |
|
int state = 0; |
|
int priority = 0; |
|
std::string name = "Arch"; |
|
std::string save_path; |
|
}; |
|
|
|
class TestTorrent { |
|
public: |
|
TestTorrent(const libtorrent::add_torrent_params ¶ms); |
|
TestTorrent() {} |
|
bool is_valid() const; |
|
libtorrent::sha1_hash info_hash() const; |
|
TorrentStatus status(int type = 0); |
|
int query_name = 1; |
|
int query_save_path = 2; |
|
bool valid = true; |
|
int upload_limit_ = 0; |
|
int upload_limit() const; |
|
int download_limit_ = 0; |
|
int download_limit() const; |
|
libtorrent::sha1_hash hash_; |
|
TorrentStatus status_; |
|
}; |
|
|
|
const auto torrent_url = "http://sout.no/torrent.torrent"; |
|
const std::string torrent_id = "c0b0a90089710812fe8c37385a4cc2978eabf3e8"; |
|
|
|
const nlohmann::json torrent_json = { |
|
{"info_hash", torrent_id}, |
|
{"paused", false}, |
|
{"seeding", false}, |
|
{"state", 0}, |
|
{"priority", 0}, |
|
{"up_limit", 0}, |
|
{"down_limit", 0}, |
|
{"name", "Arch"}}; |
|
|
|
#endif |