Fixes Invalid ratio error when ratio is not set

I would recommend undoing 7673cd5cc9 for the time being
as some of the client scripts have code dependent on the input being a string.
This commit is contained in:
sammy2142 2014-05-12 11:31:44 +01:00
parent 1d01d2bc52
commit e42cdb5b4a

View file

@ -85,12 +85,12 @@ class TransmissionAPI(GenericClient):
ratio = result.ratio
elif sickbeard.TORRENT_RATIO:
ratio = sickbeard.TORRENT_RATIO
try:
float(ratio)
except ValueError:
logger.log(self.name + u': Invalid Ratio. "' + ratio + u'" is not a number', logger.ERROR)
return False
if ratio:
try:
float(ratio)
except ValueError:
logger.log(self.name + u': Invalid Ratio. "' + ratio + u'" is not a number', logger.ERROR)
return False
torrent_id = self._get_torrent_hash(result)