forked from TrueCloudLab/rclone
stats: correct spelling of data rate units
This commit is contained in:
parent
98579608ec
commit
2ec0c8d45f
1 changed files with 14 additions and 11 deletions
|
@ -294,20 +294,23 @@ func (s *StatsInfo) String() string {
|
||||||
|
|
||||||
s.mu.RLock()
|
s.mu.RLock()
|
||||||
|
|
||||||
elapsedTime := time.Since(startTime)
|
|
||||||
elapsedTimeSecondsOnly := elapsedTime.Truncate(time.Second/10) % time.Minute
|
|
||||||
|
|
||||||
displaySpeed := ts.speed
|
|
||||||
if s.ci.DataRateUnit == "bits" {
|
|
||||||
displaySpeed *= 8
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buf = &bytes.Buffer{}
|
buf = &bytes.Buffer{}
|
||||||
xfrchkString = ""
|
xfrchkString = ""
|
||||||
dateString = ""
|
dateString = ""
|
||||||
|
elapsedTime = time.Since(startTime)
|
||||||
|
elapsedTimeSecondsOnly = elapsedTime.Truncate(time.Second/10) % time.Minute
|
||||||
|
displaySpeed = ts.speed
|
||||||
|
displaySpeedUnit string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if s.ci.DataRateUnit == "bits" {
|
||||||
|
displaySpeed *= 8
|
||||||
|
displaySpeedUnit = "bit/s"
|
||||||
|
} else {
|
||||||
|
displaySpeedUnit = "Byte/s"
|
||||||
|
}
|
||||||
|
|
||||||
if !s.ci.StatsOneLine {
|
if !s.ci.StatsOneLine {
|
||||||
_, _ = fmt.Fprintf(buf, "\nTransferred: ")
|
_, _ = fmt.Fprintf(buf, "\nTransferred: ")
|
||||||
} else {
|
} else {
|
||||||
|
@ -330,9 +333,9 @@ func (s *StatsInfo) String() string {
|
||||||
_, _ = fmt.Fprintf(buf, "%s%10s / %s, %s, %s, ETA %s%s",
|
_, _ = fmt.Fprintf(buf, "%s%10s / %s, %s, %s, ETA %s%s",
|
||||||
dateString,
|
dateString,
|
||||||
fs.SizeSuffix(s.bytes),
|
fs.SizeSuffix(s.bytes),
|
||||||
fs.SizeSuffix(ts.totalBytes).Unit("Bytes"),
|
fs.SizeSuffix(ts.totalBytes).Unit("Byte"),
|
||||||
percent(s.bytes, ts.totalBytes),
|
percent(s.bytes, ts.totalBytes),
|
||||||
fs.SizeSuffix(displaySpeed).Unit(strings.Title(s.ci.DataRateUnit)+"/s"),
|
fs.SizeSuffix(displaySpeed).Unit(displaySpeedUnit),
|
||||||
etaString(s.bytes, ts.totalBytes, ts.speed),
|
etaString(s.bytes, ts.totalBytes, ts.speed),
|
||||||
xfrchkString,
|
xfrchkString,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue