file_progress support for magnet links

This commit is contained in:
Arvid Norberg 2012-08-26 06:38:29 +00:00
parent 6cd2958fa4
commit 2665d2a4e1
1 changed files with 7 additions and 1 deletions

View File

@ -8101,6 +8101,8 @@ namespace libtorrent
void torrent::file_progress(std::vector<float>& fp) const
{
fp.clear();
if (!valid_metadata()) return;
fp.resize(m_torrent_file->num_files(), 1.f);
if (is_seed()) return;
@ -8117,7 +8119,11 @@ namespace libtorrent
void torrent::file_progress(std::vector<size_type>& fp, int flags) const
{
TORRENT_ASSERT(valid_metadata());
if (!valid_metadata())
{
fp.clear();
return;
}
fp.resize(m_torrent_file->num_files(), 0);