8 changed files with 116 additions and 34 deletions
@ -1,13 +1,31 @@ |
|||||||
#include <TorrentContext.hpp> |
#include <TorrentContext.hpp> |
||||||
|
|
||||||
InfoHash TestTorrent::info_hash() { |
|
||||||
return hash; |
|
||||||
} |
|
||||||
|
|
||||||
TorrentStatus TestTorrent::status(int type) { |
TorrentStatus TestTorrent::status(int type) { |
||||||
return status_; |
return status_; |
||||||
} |
} |
||||||
|
|
||||||
bool TestTorrent::is_valid() { |
bool TestTorrent::is_valid() { |
||||||
return valid; |
return valid; |
||||||
|
} |
||||||
|
|
||||||
|
int TestTorrent::upload_limit() { |
||||||
|
return upload_limit_; |
||||||
|
} |
||||||
|
|
||||||
|
int TestTorrent::download_limit() { |
||||||
|
return download_limit_; |
||||||
|
} |
||||||
|
|
||||||
|
TestTorrent::TestTorrent(const libtorrent::add_torrent_params ¶ms) { |
||||||
|
auto paused = (params.flags & libtorrent::add_torrent_params::flag_paused) == libtorrent::add_torrent_params::flag_paused; |
||||||
|
status_.paused = paused; |
||||||
|
status_.save_path = params.save_path; |
||||||
|
status_.name = params.name; |
||||||
|
upload_limit_ = params.upload_limit; |
||||||
|
download_limit_ = params.download_limit; |
||||||
|
hash_ = params.info_hash; |
||||||
|
} |
||||||
|
|
||||||
|
libtorrent::sha1_hash TestTorrent::info_hash() const { |
||||||
|
return hash_; |
||||||
} |
} |
||||||
Loading…
Reference in new issue