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(s, True),
|
||||||
xml(_('Loading, please wait'))+'…',
|
xml(_('Loading, please wait'))+'…',
|
||||||
unicode(c),
|
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),
|
hexlify(s.encode('utf-8'))), True),
|
||||||
self.opts.url_prefix)
|
self.opts.url_prefix)
|
||||||
for s, c in category_groups.items()]
|
for s, c in category_groups.items()]
|
||||||
@ -531,6 +532,13 @@ class BrowseServer(object):
|
|||||||
sort = None
|
sort = None
|
||||||
if sort not in ('rating', 'name', 'popularity'):
|
if sort not in ('rating', 'name', 'popularity'):
|
||||||
sort = 'name'
|
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()
|
categories = self.categories_cache()
|
||||||
if category not in categories:
|
if category not in categories:
|
||||||
raise cherrypy.HTTPError(404, 'category not found')
|
raise cherrypy.HTTPError(404, 'category not found')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user