uTorrent ratio issue fixed

The tryFloat function returns 0 if it is fed with a float(!). This resulted in the seed_ratio being set to 0 on first/automatic download. When manually downloading, it did work as the ratio is stored as a string.
This commit is contained in:
mano3m
2013-07-31 15:04:48 +02:00
parent 470fde0890
commit fd95364d5f
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -140,7 +140,11 @@ def tryInt(s):
except: return 0
def tryFloat(s):
try: return float(s) if '.' in s else tryInt(s)
try:
if isinstance(s, str):
return float(s) if '.' in s else tryInt(s)
else:
return float(s)
except: return 0
def natsortKey(s):