From e42cdb5b4a5a92726e6b5ead1b8374390e564865 Mon Sep 17 00:00:00 2001 From: sammy2142 Date: Mon, 12 May 2014 11:31:44 +0100 Subject: [PATCH] Fixes Invalid ratio error when ratio is not set I would recommend undoing 7673cd5cc9d8e797a5b83cf956ede4eaae3deb7e for the time being as some of the client scripts have code dependent on the input being a string. --- sickbeard/clients/transmission.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sickbeard/clients/transmission.py b/sickbeard/clients/transmission.py index 82a87cd2..6f3e0e22 100644 --- a/sickbeard/clients/transmission.py +++ b/sickbeard/clients/transmission.py @@ -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)