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.
|
|
|
|
#include <TorrentContext.hpp>
|
|
|
|
|
|
|
|
|
|
TorrentStatus TestTorrent::status(int type) {
|
|
|
|
|
return status_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TestTorrent::is_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_;
|
|
|
|
|
}
|