Content server: Fix virtual libraries with an ampersand in their names not working

This commit is contained in:
Kovid Goyal 2013-11-15 15:02:19 +05:30
parent 349e097fe2
commit 474e7401e5

View File

@ -155,15 +155,13 @@ def get_category_items(category, items, datatype, prefix): # {{{
'<div>{1}</div>'
'<div>{2}</div></div>')
rating, rstring = render_rating(i.avg_rating, prefix)
if i.use_sort_as_name:
name = xml(i.sort)
else:
name = xml(i.name)
orig_name = i.sort if i.use_sort_as_name else i.name
name = xml(orig_name)
if datatype == 'rating':
name = xml(_('%d stars')%int(i.avg_rating))
id_ = i.id
if id_ is None:
id_ = hexlify(force_unicode(name).encode('utf-8'))
id_ = hexlify(force_unicode(orig_name).encode('utf-8'))
id_ = xml(str(id_))
desc = ''
if i.count > 0:
@ -675,7 +673,7 @@ class BrowseServer(object):
which = unhexlify(cid).decode('utf-8')
vls = self.db.prefs.get('virtual_libraries', {})
ids = self.search_cache(vls[which])
category_name = _('virtual library: ') + which
category_name = _('virtual library: ') + xml(which)
if not ids:
msg = _('The virtual library <b>%s</b> has no books.') % prepare_string_for_xml(which)
if self.search_restriction: