From 8a6e6c07e7b1d9edee0cc1aa9c775849d9e544aa Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 16 Oct 2010 15:28:25 +0100 Subject: [PATCH] Get the icons --- src/calibre/library/server/browse.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index dc8494dc13..e4d001c959 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -18,6 +18,7 @@ from calibre.utils.filenames import ascii_filename from calibre.utils.config import prefs from calibre.library.comments import comments_to_html from calibre.library.server import custom_fields_to_display +from calibre.library.field_metadata import category_icon_map def render_book_list(ids, suffix=''): # {{{ pages = [] @@ -279,6 +280,16 @@ class BrowseServer(object): continue if meta['is_custom'] and category not in displayed_custom_fields: continue + # get the icon files + if category in category_icon_map: + icon = I(category_icon_map[category]) + elif meta['is_custom']: + icon = I(category_icon_map[':custom']) + elif meta['kind'] == 'user': + icon = I(category_icon_map[':user']) + else: + icon = None # shouldn't get here + cats.append((meta['name'], category)) cats = ['
  • {0}/browse/category/{1}
  • '\ .format(xml(x, True), xml(quote(y)), xml(_('Browse books by')))