Opened 7 years ago

Last modified 4 years ago

#4747 new Enhancement

Make file/bandwidth size calculation configurable whether base-10 or base-2 is used

Reported by: leena Owned by:
Priority: Lowest Milestone: None Set
Component: Transmission Version: 2.42
Severity: Trivial Keywords: patch-needed
Cc:

Description

Like almost all other unix tools, the user should be allowed to choose whether he wants sizes calculated in base-10 or base-2. It's understandable if you want to make the guis less confusing, but for the daemon and command-line tools, this should be configurable.

Attachments (3)

iec-units.patch (10.3 KB) - added by rb07 7 years ago.
Adds unit selection (IEC or SI) to Transmission-Qt.
prefs-dialog.cc.diff (4.3 KB) - added by rb07 7 years ago.
Includes label update in prefs panel.
IEC-size-units.patch (6.4 KB) - added by darealshinji 4 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 7 years ago by jordan

Like almost all other unix tools

I'm curious about this. I picked a handful of gui and text apps I often use -- Nautilus, Firefox, gnome-system-monitor, Gimp, apt-get, wget, top, curl -- and did not find any of them allowing configuration of the units.

Which unix tools did you have in mind when you said that?

comment:2 Changed 7 years ago by leena

Unix tools traditionally use kilobytes to mean 1024 bytes. These allow choosing between base-2 and base-10:

Almost every other unix tool on my system (Mac OS X) uses only base-2. That includes wget, curl, find, git, ...

comment:3 Changed 7 years ago by gunzip

OMG! r13195 (use base-10 units for network bandwidth and disk sizes) would be a disaster if it stands.

this would be equivalent to having the speedometer in my car in units of yards/sec when the world i live in uses mph everywhere. sure it might be technically correct, but as a practical matter it would be annoying and confusing.

what could be the reason for stepping into this abyss, as this issue was resolved many moons ago?

</rant>

comment:4 Changed 7 years ago by jordan

  • Keywords patch-needed added
  • Priority changed from Normal to Lowest
  • Severity changed from Normal to Trivial

It seems clear to me that apps are heading in the direction of base 10 for network bandwidth and disk space. I'm not overjoyed with it, but IMO the writing is on the wall.

If anyone wants to cook up a patch for this to make things configurable, and the patch (1) is clean (2) is tested (3) works, I'll probably use it. But for the reasons listed in the previous paragraph I'm not going to write it.

comment:5 Changed 7 years ago by gunzip

using r13198

$ man transmission-remote

.
-d --downlimit limit
          Limit the maximum download speed to limit KiB/s.
.

how does this affect input speed values passed thru tr-remote, the web-ui, and settings.json. are inputs still in base-2 but reported values are converted to base-10?

as you can imagine, it doesn't take much for me to get confused.

comment:6 Changed 7 years ago by jordan

Fixed the manpage, thanks.

the generic 'kb' units in settings.json et al will be interpreted as base-10 rather than base-2.

comment:7 follow-up: Changed 7 years ago by gunzip

just for the record, i'm seeing more negative fallout in potentially switching to base-10.

transmission-remote-cli.py, the remote command line client which i use quite regularly, now has discrepancies in the inputted vs. actual speeds which weren't there before. other third-party apps most likely will be adversely affected.

anyway, this seems a high price to pay for essentially converting to phony base-ten units.

Last edited 7 years ago by gunzip (previous) (diff)

comment:8 in reply to: ↑ 7 Changed 7 years ago by jordan

Replying to gunzip:

just for the record, i'm seeing more negative fallout in potentially switching to base-10.

transmission-remote-cli.py, the remote command line client which i use quite regularly, now has discrepancies in the inputted vs. actual speeds which weren't there before. other third-party apps most likely will be adversely affected.

anyway, this seems a high price to pay for essentially converting to phony base-ten units.

If anyone wants to cook up a patch for this to make things configurable, and the patch (1) is clean (2) is tested (3) works, I'll probably use it. But for the reasons listed in the previous paragraph I'm not going to write it.

comment:9 Changed 7 years ago by livings124

This ticket conflicts with #4703.

comment:10 Changed 7 years ago by rb07

Patch for Transmission-Qt included.

Works? Yes.

Tested? Yes, a little, open questions: does it work with remote sessions? probably, but needs testing, what if the daemon has r13195 reverted, like mine? what if not?

Clean? I think so.

Complete? No, a minor detail I show in the screenshots: I'm not changing the label in the preferences (it will be updated next time you open Preferences), but you can also see that the status bar is changing immediately.

The patch depends on ticket #4703 not being implemented (i.e. uses the libtransmission functionality that ticket would eliminate).

The result looks like this:

http://img502.imageshack.us/img502/416/unitssi.png

http://img401.imageshack.us/img401/4118/unitsiec.png

comment:11 Changed 7 years ago by rb07

Found a bug in the patched application, I didn't update each torrent's properties speed limits (it shows the original limit), but the daemon* is using the updated limit (i.e. 97 kB/s instead of 95 KiB/s shown in the properties).

'* Remember this is a modified daemon, with r13195 reverted.

Changed 7 years ago by rb07

Adds unit selection (IEC or SI) to Transmission-Qt.

comment:12 Changed 7 years ago by rb07

Patch now includes updating each torrent's speed limits (used or not).

If a torrent properties panel is open, the values don't show the change until the next time the panel is open (both the label and the value).

Changed 7 years ago by rb07

Includes label update in prefs panel.

comment:13 Changed 6 years ago by base2

One more vote for base-2 unit prefixes. I am using Transmission on Mac OS 10.6 and would like to see base-2 numbers again.

It would be fine for me, if it was a "hidden" configuration option (e.g. in a configuration file instead of the GUI) or if the labels would not differentiate between "kB" and "KiB", if those things would make it easier to implement.

comment:14 Changed 4 years ago by mike.dld

Marked #5939 as duplicate of this ticket.

Changed 4 years ago by darealshinji

comment:15 Changed 4 years ago by darealshinji

Here's a patch to set IEC units at build time: https://gist.github.com/darealshinji/4f07a5d2f9701da223f7

Note: See TracTickets for help on using tickets.