[gpodder-devel] The mighty episode selection dialog :)

  • From: thp at perli.net (Thomas Perl)
  • Date: Fri, 09 Nov 2007 10:09:02 +0100

Hello, Pieter!

On Fri, 2007-11-09 at 08:37 +0100, Pieter De Decker wrote:
> That *is* pretty cool. I did notice however that gPodder now suddenly
> uses "MiB" instead of "MB" and "KiB" instead of "KB", even outside the
> selection dialog. Have you implemented a more accurate Python file size
> calculation algorithm by any chance?

Well, as Gerrit Sangel initially pointed out in late October[1], we were
using SI units (MB, GB, ...) that should be 10^x (i.e. 1.000.000 bytes)
instead of binary 2^(10*x) (i.e. 1.024 bytes or 1.048.576 bytes).

Binary units are perfectly fine, but their official standard names are
described in [2], i.e. KiB, MiB, GiB, etc..

So, what we decided[3] to do is to default to binary units (as these
will lead the same numbers as 0.10.1 and before), fix the unit names
(therefore you now see MiB instead of the previously wrongly-used MB)
and add the option to switch to SI units (10^x, MB, kB, ...).

As we consider this an "expert setting", I don't want to add support for
it in the preferences dialog as to not bloat the settings unnecessarily.

If you want to switch to SI units, you can do the following:

  1.) Close gPodder if it's running
  2.) Open ~/.config/gpodder/gpodder.conf in your favourite editor
  3.) Set the setting "use_si_units = False" to "use_si_units = True"
  4.) Save and start gPodder again - all units will be displayed

Oh, and what I just saw thanks to your question -- I've forgot to use
the correct (config-using) format_filesize() function, so the episode
dialog would always display binary units, regardless of what you set as
your preference. This should be fixed in the latest SVN revision, so the
setting you choose in gpodder.conf should affect all size displays in
the gPodder GUI :) Thanks for asking, I wouldn't have looked at that
again and the bug would have probably stayed in there for some more
weeks =)

Thomas

[1] https://lists.berlios.de/pipermail/gpodder-devel/2007-October/001115.html
[2] http://physics.nist.gov/cuu/Units/binary.html
[3] https://lists.berlios.de/pipermail/gpodder-devel/2007-November/001139.html



Other related posts: