Fix #1095 incorrect piece size used when using some non-English languages
This commit is contained in:
parent
f03d1818fa
commit
a161bbfcb6
|
@ -115,9 +115,13 @@ class CreateTorrentDialog:
|
||||||
|
|
||||||
def parse_piece_size_text(self, value):
|
def parse_piece_size_text(self, value):
|
||||||
psize, metric = value.split()
|
psize, metric = value.split()
|
||||||
psize = int(psize) * 1024
|
psize = int(psize)
|
||||||
if metric[0] == 'M':
|
if psize < 32:
|
||||||
psize *= 1024
|
# This is a MiB value
|
||||||
|
psize = psize * 1024 * 1024
|
||||||
|
else:
|
||||||
|
# This is a KiB value
|
||||||
|
psize = psize * 1024
|
||||||
|
|
||||||
return psize
|
return psize
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue