minor cleanups around saving resume data

This commit is contained in:
arvidn 2018-07-11 12:44:25 +02:00 committed by Arvid Norberg
parent 76ef8b9d72
commit 37a6a47ea3
3 changed files with 5 additions and 9 deletions

View File

@ -1306,10 +1306,6 @@ example alert_masks:
continue;
}
// we're loading this torrent from resume data. There's no need to
// re-save the resume data immediately.
p.flags &= ~lt::torrent_flags::need_save_resume;
ses.async_add_torrent(std::move(p));
}
}
@ -1960,9 +1956,8 @@ COLUMN OPTIONS
std::vector<torrent_status> const temp = ses.get_torrent_status(
[](torrent_status const& st)
{
if (!st.handle.is_valid()) return false;
if (!st.has_metadata) return false;
if (!st.need_save_resume) return false;
if (!st.handle.is_valid() || !st.has_metadata || !st.need_save_resume)
return false;
return true;
}, {});

View File

@ -693,8 +693,7 @@ TORRENT_IPV6_NAMESPACE_END
// torrent_handle& h = *i;
// if (!h.is_valid()) continue;
// torrent_status s = h.status();
// if (!s.has_metadata) continue;
// if (!s.need_save_resume_data()) continue;
// if (!s.has_metadata || !s.need_save_resume_data()) continue;
//
// h.save_resume_data();
// ++outstanding_resume_data;

View File

@ -342,6 +342,8 @@ namespace {
}
}
// we're loading this torrent from resume data. There's no need to
// re-save the resume data immediately.
ret.flags &= ~torrent_flags::need_save_resume;
return ret;