Content server: Fix grouping for categories based on custom columns. Fixes #919011 (Server does not support _ in genre name)

This commit is contained in:
Kovid Goyal 2012-01-20 09:45:54 +05:30
parent 5e677a39a5
commit da80d73f15

View File

@ -497,7 +497,8 @@ class BrowseServer(object):
xml(s, True),
xml(_('Loading, please wait'))+'…',
unicode(c),
xml(u'/browse/category_group/%s/%s'%(category,
xml(u'/browse/category_group/%s/%s'%(
hexlify(category.encode('utf-8')),
hexlify(s.encode('utf-8'))), True),
self.opts.url_prefix)
for s, c in category_groups.items()]
@ -531,6 +532,13 @@ class BrowseServer(object):
sort = None
if sort not in ('rating', 'name', 'popularity'):
sort = 'name'
try:
category = unhexlify(category)
if isbytestring(category):
category = category.decode('utf-8')
except:
raise cherrypy.HTTPError(404, 'invalid category')
categories = self.categories_cache()
if category not in categories:
raise cherrypy.HTTPError(404, 'category not found')