mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-20 00:28:31 +00:00
Fix #1095 incorrect piece size used when using some non-English languages
This commit is contained in:
parent
fe6c89a2e1
commit
8c265bb308
2 changed files with 8 additions and 3 deletions
|
@ -32,6 +32,7 @@
|
|||
* Made the password dialog prettier
|
||||
* Fix #1086 deprecated gtk.Tooltips usage
|
||||
* Fix #768 save tracker list for create torrent dialog
|
||||
* Fix #1095 incorrect piece size used when using some non-English languages
|
||||
|
||||
==== Console ====
|
||||
* Fix using the console in Windows, but only in command-line mode
|
||||
|
|
|
@ -115,9 +115,13 @@ class CreateTorrentDialog:
|
|||
|
||||
def parse_piece_size_text(self, value):
|
||||
psize, metric = value.split()
|
||||
psize = int(psize) * 1024
|
||||
if metric[0] == 'M':
|
||||
psize *= 1024
|
||||
psize = int(psize)
|
||||
if psize < 32:
|
||||
# This is a MiB value
|
||||
psize = psize * 1024 * 1024
|
||||
else:
|
||||
# This is a KiB value
|
||||
psize = psize * 1024
|
||||
|
||||
return psize
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue