mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-14 13:16:17 +00:00
Don't delay scraping for newly added torrents
This commit is contained in:
@@ -106,7 +106,8 @@ DownloadFactory::DownloadFactory(Manager* m) :
|
|||||||
m_session(false),
|
m_session(false),
|
||||||
m_start(false),
|
m_start(false),
|
||||||
m_printLog(true),
|
m_printLog(true),
|
||||||
m_isFile(false) {
|
m_isFile(false),
|
||||||
|
m_initLoad(false) {
|
||||||
|
|
||||||
m_taskLoad.slot() = std::bind(&DownloadFactory::receive_load, this);
|
m_taskLoad.slot() = std::bind(&DownloadFactory::receive_load, this);
|
||||||
m_taskCommit.slot() = std::bind(&DownloadFactory::receive_commit, this);
|
m_taskCommit.slot() = std::bind(&DownloadFactory::receive_commit, this);
|
||||||
@@ -276,8 +277,9 @@ DownloadFactory::receive_success() {
|
|||||||
if (!rpc::call_command_value("trackers.use_udp"))
|
if (!rpc::call_command_value("trackers.use_udp"))
|
||||||
download->enable_udp_trackers(false);
|
download->enable_udp_trackers(false);
|
||||||
|
|
||||||
// Don't force the trackers to scrape when rTorrent first starts
|
// Skip forcing trackers to scrape when rtorrent starts
|
||||||
download->set_resume_flags(torrent::Download::start_skip_tracker);
|
if (m_initLoad)
|
||||||
|
download->set_resume_flags(torrent::Download::start_skip_tracker);
|
||||||
|
|
||||||
// Check first if we already have these values set in the session
|
// Check first if we already have these values set in the session
|
||||||
// torrent, so that it is safe to change the values.
|
// torrent, so that it is safe to change the values.
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ public:
|
|||||||
bool get_start() const { return m_start; }
|
bool get_start() const { return m_start; }
|
||||||
void set_start(bool v) { m_start = v; }
|
void set_start(bool v) { m_start = v; }
|
||||||
|
|
||||||
|
bool get_init_load() const { return m_initLoad; }
|
||||||
|
void set_init_load(bool v) { m_initLoad = v; }
|
||||||
|
|
||||||
bool print_log() const { return m_printLog; }
|
bool print_log() const { return m_printLog; }
|
||||||
void set_print_log(bool v) { m_printLog = v; }
|
void set_print_log(bool v) { m_printLog = v; }
|
||||||
|
|
||||||
@@ -106,6 +109,7 @@ private:
|
|||||||
bool m_start;
|
bool m_start;
|
||||||
bool m_printLog;
|
bool m_printLog;
|
||||||
bool m_isFile;
|
bool m_isFile;
|
||||||
|
bool m_initLoad;
|
||||||
|
|
||||||
command_list_type m_commands;
|
command_list_type m_commands;
|
||||||
torrent::Object::map_type m_variables;
|
torrent::Object::map_type m_variables;
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ load_session_torrents() {
|
|||||||
|
|
||||||
// Replace with session torrent flag.
|
// Replace with session torrent flag.
|
||||||
f->set_session(true);
|
f->set_session(true);
|
||||||
|
f->set_init_load(true);
|
||||||
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
|
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
|
||||||
f->load(entries.path() + first->d_name);
|
f->load(entries.path() + first->d_name);
|
||||||
f->commit();
|
f->commit();
|
||||||
@@ -149,6 +150,7 @@ load_arg_torrents(char** first, char** last) {
|
|||||||
|
|
||||||
// Replace with session torrent flag.
|
// Replace with session torrent flag.
|
||||||
f->set_start(true);
|
f->set_start(true);
|
||||||
|
f->set_init_load(true);
|
||||||
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
|
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
|
||||||
f->load(*first);
|
f->load(*first);
|
||||||
f->commit();
|
f->commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user