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):
|
||||
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…
Reference in New Issue