mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* Don't show ETA on finished and stopped torrents.
* Added percentage completed to active unfinished torrents. * Re-enabled different seeding and leeching priorities. * Make a temporary container in AvailableList::insert(AddressList*) when doing std::set_differernce. AvailableList's std::vector would resize and cause invalidated iterators to be used. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@630 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+21
-5
@@ -164,12 +164,20 @@ print_download_info(char* first, char* last, core::Download* d) {
|
||||
(double)d->get_download().bytes_done() / (double)(1 << 20),
|
||||
(double)d->get_download().bytes_total() / (double)(1 << 20));
|
||||
|
||||
first = print_buffer(first, last, " Rate: %5.1f / %5.1f KB Uploaded: %7.1f MB ",
|
||||
first = print_buffer(first, last, " Rate: %5.1f / %5.1f KB Uploaded: %7.1f MB",
|
||||
(double)d->get_download().up_rate()->rate() / (1 << 10),
|
||||
(double)d->get_download().down_rate()->rate() / (1 << 10),
|
||||
(double)d->get_download().up_rate()->total() / (1 << 20));
|
||||
|
||||
first = print_download_time_left(first, last, d);
|
||||
if (d->get_download().is_active() && !d->is_done()) {
|
||||
first = print_buffer(first, last, " ");
|
||||
first = print_download_percentage_done(first, last, d);
|
||||
|
||||
first = print_buffer(first, last, " ");
|
||||
first = print_download_time_left(first, last, d);
|
||||
} else {
|
||||
first = print_buffer(first, last, " ");
|
||||
}
|
||||
|
||||
if (d->priority() != 2)
|
||||
first = print_buffer(first, last, " [%s]", core::Download::priority_to_string(d->priority()));
|
||||
@@ -210,10 +218,9 @@ print_download_status(char* first, char* last, core::Download* d) {
|
||||
|
||||
char*
|
||||
print_download_time_left(char* first, char* last, core::Download* d) {
|
||||
uint32_t rate;
|
||||
uint32_t rate = d->get_download().down_rate()->rate();
|
||||
|
||||
if (!d->get_download().is_active() ||
|
||||
(rate = d->get_download().down_rate()->rate()) < 512)
|
||||
if (rate < 512)
|
||||
return print_buffer(first, last, "--:--:--");
|
||||
|
||||
time_t remaining = (d->get_download().bytes_total() - d->get_download().bytes_done()) / (rate & ~(uint32_t)(512 - 1));
|
||||
@@ -221,6 +228,15 @@ print_download_time_left(char* first, char* last, core::Download* d) {
|
||||
return print_ddhhmm(first, last, remaining);
|
||||
}
|
||||
|
||||
char*
|
||||
print_download_percentage_done(char* first, char* last, core::Download* d) {
|
||||
if (!d->is_open() || d->is_done())
|
||||
//return print_buffer(first, last, "[--%%]");
|
||||
return print_buffer(first, last, " ");
|
||||
else
|
||||
return print_buffer(first, last, "[%2u%%]", (d->get_download().chunks_done() * 100) / d->get_download().chunks_total());
|
||||
}
|
||||
|
||||
char*
|
||||
print_status_info(char* first, char* last) {
|
||||
if (torrent::up_throttle() == 0)
|
||||
|
||||
Reference in New Issue
Block a user