From 5fc39a7c138a585aedac1bd4e1cc1c22d8f015a1 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Mon, 3 Aug 2015 22:56:30 +0300 Subject: [PATCH] 2.6 fix --- .idea/workspace.xml | 116 +++++++++++++++++------------------ resources/btclient/common.py | 6 +- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c01e97b..f6e2b7a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,13 +2,7 @@ - - - - - - @@ -180,13 +174,14 @@ - + - - + + + @@ -239,12 +234,14 @@ - + - - - + + + + + @@ -269,7 +266,7 @@ - + @@ -426,9 +423,9 @@ @@ -464,6 +461,8 @@ + + @@ -516,8 +515,6 @@ - - @@ -700,12 +697,6 @@ @@ -1019,14 +1016,15 @@ - + + - + @@ -1038,7 +1036,6 @@ - @@ -1076,11 +1073,11 @@ - - @@ -1588,14 +1585,6 @@ - - - - - - - - @@ -1606,12 +1595,26 @@ - + - + - + + + + + + + + + + + + + + + @@ -1619,7 +1622,7 @@ - + @@ -1639,25 +1642,22 @@ - + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/btclient/common.py b/resources/btclient/common.py index 7bcca39..8cea8c2 100644 --- a/resources/btclient/common.py +++ b/resources/btclient/common.py @@ -446,7 +446,11 @@ class AbstractFile(object): if not self._rate: d = self.duration if d: - self._rate = self.size / d.total_seconds() + if hasattr(d, 'total_seconds'): + total_seconds=d.total_seconds() + else: + total_seconds=(d.microseconds + (d.seconds + d.days * 24 * 3600) * 10**6) / 10**6 + self._rate = self.size / total_seconds return self._rate def __str__(self):