1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-25 01:01:47 +00:00

FIX:(#1523) filesize of torrent polled from an rss feed has a comma in the size field

This commit is contained in:
evilhero 2017-01-10 18:47:20 -05:00
parent f2cb786b69
commit cc231a416c

View file

@ -162,7 +162,7 @@ def human2bytes(s):
"""
symbols = ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
letter = s[-1:].strip().upper()
num = s[:-1]
num = re.sub(',', '', s[:-1])
#assert num.isdigit() and letter in symbols
#use below assert statement to handle sizes with decimal places
assert float(num) and letter in symbols