mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #9090: Browsing user categories over OPDS gives 500 Internal server error
This commit is contained in:
parent
ff912773cf
commit
2e9c93e33c
@ -313,24 +313,10 @@ class CategoryFeed(NavFeed):
|
||||
ignore_count = False
|
||||
if which == 'search':
|
||||
ignore_count = True
|
||||
uc = None
|
||||
if which.endswith(':'):
|
||||
# We have a user category. Translate back to original categories
|
||||
uc = {}
|
||||
try:
|
||||
ucs = db.prefs['user_categories']
|
||||
ucs = ucs.get(which[:-1])
|
||||
for name, category, index in ucs:
|
||||
uc[name] = category
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
uc = None
|
||||
for item in items:
|
||||
if uc: which = uc.get(item.name, which)
|
||||
self.root.append(CATALOG_ENTRY(item, which, base_href, version,
|
||||
self.root.append(CATALOG_ENTRY(item, item.category, base_href, version,
|
||||
updated, ignore_count=ignore_count,
|
||||
add_kind=uc is not None))
|
||||
add_kind=which != item.category))
|
||||
|
||||
class CategoryGroupFeed(NavFeed):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user