mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-09-16 08:22:55 +00:00
bytesCompleted for torrents with multiple files
This commit is contained in:
@@ -292,14 +292,19 @@ namespace torrents
|
||||
files.push_back (file);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto filesCompleted = torrent->GetFilesCompleted ();
|
||||
size_t ind = 0;
|
||||
for (const auto& [filePath, fileSize]: torrentFiles)
|
||||
{
|
||||
boost::json::object file;
|
||||
file["name"] = filePath.string ();
|
||||
file["length"] = fileSize;
|
||||
file["bytesCompleted"] = 0; // TODO:
|
||||
file["bytesCompleted"] = (ind < filesCompleted.size ()) ? filesCompleted[ind] : 0;
|
||||
files.push_back (file);
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
return files;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user