mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
4f51fc439e
commit
502193eb24
@ -113,7 +113,10 @@ class TagTreeItem(object): # {{{
|
|||||||
if self.tag.avg_rating:
|
if self.tag.avg_rating:
|
||||||
total += 1
|
total += 1
|
||||||
num += self.tag.avg_rating
|
num += self.tag.avg_rating
|
||||||
return num/float(total)
|
try:
|
||||||
|
return num/float(total)
|
||||||
|
except ZeroDivisionError:
|
||||||
|
return 0
|
||||||
|
|
||||||
def data(self, role):
|
def data(self, role):
|
||||||
if role == Qt.UserRole:
|
if role == Qt.UserRole:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user