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