fix attribute error
This commit is contained in:
parent
2b29dc7366
commit
c6779ab0f1
@ -984,7 +984,10 @@ class Manager:
|
|||||||
# Calculations
|
# Calculations
|
||||||
|
|
||||||
def calc_ratio(self, unique_ID, torrent_state):
|
def calc_ratio(self, unique_ID, torrent_state):
|
||||||
up = float((self.unique_IDs[unique_ID].initial_uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024)
|
try:
|
||||||
|
up = float((self.unique_IDs[unique_ID].initial_uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024)
|
||||||
|
except AttributeError:
|
||||||
|
up = float(self.get_core_torrent_state(unique_ID, False) / 1024)
|
||||||
down = float(torrent_state["total_done"] / 1024)
|
down = float(torrent_state["total_done"] / 1024)
|
||||||
try:
|
try:
|
||||||
ret = up/down
|
ret = up/down
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user