Fix #9090: Browsing user categories over OPDS gives 500 Internal server error

This commit is contained in:
Charles Haley 2011-02-21 17:07:43 +00:00
parent ff912773cf
commit 2e9c93e33c

View File

@ -313,24 +313,10 @@ class CategoryFeed(NavFeed):
ignore_count = False ignore_count = False
if which == 'search': if which == 'search':
ignore_count = True 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: for item in items:
if uc: which = uc.get(item.name, which) self.root.append(CATALOG_ENTRY(item, item.category, base_href, version,
self.root.append(CATALOG_ENTRY(item, which, base_href, version,
updated, ignore_count=ignore_count, updated, ignore_count=ignore_count,
add_kind=uc is not None)) add_kind=which != item.category))
class CategoryGroupFeed(NavFeed): class CategoryGroupFeed(NavFeed):