mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 03:13:24 +02:00
Fix multiple ratings displayed in Tag Browser for some legacy databases
This commit is contained in:
parent
f715da2ad5
commit
169ec93134
1 changed files with 9 additions and 0 deletions
|
|
@ -782,6 +782,15 @@ def get_categories(self, sort='name', ids=None, icon_map=None):
|
|||
icon=icon, tooltip=tooltip)
|
||||
for r in data if item_not_zero_func(r)]
|
||||
|
||||
# Needed for legacy databases that have multiple ratings that
|
||||
# map to n stars
|
||||
for r in categories['rating']:
|
||||
for x in categories['rating']:
|
||||
if r.name == x.name and r.id != x.id:
|
||||
r.count = r.count + x.count
|
||||
categories['rating'].remove(x)
|
||||
break
|
||||
|
||||
# We delayed computing the standard formats category because it does not
|
||||
# use a view, but is computed dynamically
|
||||
categories['formats'] = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue