mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Fix grouping for categories based on custom columns. Fixes #919011 (Server does not support _ in genre name)
This commit is contained in:
parent
5e677a39a5
commit
da80d73f15
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user