mirror of
https://github.com/transmission/transmission
synced 2025-01-03 13:35:36 +00:00
fix: add 'years' and 'Infinity' to ETA in transmission-remote (#5584)
This commit is contained in:
parent
280dea4e33
commit
d0b0810457
1 changed files with 19 additions and 4 deletions
|
@ -118,7 +118,22 @@ static std::string etaToString(int64_t eta)
|
|||
return fmt::format(FMT_STRING("{:d} hrs"), eta / (60 * 60));
|
||||
}
|
||||
|
||||
if (eta < (60 * 60 * 24 * 30))
|
||||
{
|
||||
return fmt::format(FMT_STRING("{:d} days"), eta / (60 * 60 * 24));
|
||||
}
|
||||
|
||||
if (eta < (60 * 60 * 24 * 30 * 12))
|
||||
{
|
||||
return fmt::format(FMT_STRING("{:d} months"), eta / (60 * 60 * 24 * 30));
|
||||
}
|
||||
|
||||
if (eta < (60 * 60 * 24 * 365 * 1000LL)) // up to 999 years
|
||||
{
|
||||
return fmt::format(FMT_STRING("{:d} years"), eta / (60 * 60 * 24 * 365));
|
||||
}
|
||||
|
||||
return "∞";
|
||||
}
|
||||
|
||||
static std::string tr_strltime(time_t seconds)
|
||||
|
@ -1444,7 +1459,7 @@ static void printTorrentList(tr_variant* top)
|
|||
double total_down = 0;
|
||||
|
||||
printf(
|
||||
"%6s %-4s %9s %-8s %6s %6s %-5s %-11s %s\n",
|
||||
"%6s %-4s %9s %-9s %6s %6s %-5s %-11s %s\n",
|
||||
"ID",
|
||||
"Done",
|
||||
"Have",
|
||||
|
@ -1484,7 +1499,7 @@ static void printTorrentList(tr_variant* top)
|
|||
std::string{ "n/a" };
|
||||
|
||||
fmt::print(
|
||||
FMT_STRING("{:6d}{:c} {:>4s} {:>9s} {:<8s} {:6.1f} {:6.1f} {:>5s} {:<11s} {:s}\n"),
|
||||
FMT_STRING("{:6d}{:c} {:>4s} {:>9s} {:<9s} {:6.1f} {:6.1f} {:>5s} {:<11s} {:s}\n"),
|
||||
torId,
|
||||
error_mark,
|
||||
done_str,
|
||||
|
|
Loading…
Reference in a new issue