From c68a36d3c18e93c6f967695f6fe46b90a968d6d3 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 18 Dec 2010 18:14:40 +0000 Subject: [PATCH] Make the author_sort display tweak work in the content server --- resources/default_tweaks.py | 20 ++++++++++---------- src/calibre/gui2/tag_view.py | 2 +- src/calibre/library/server/browse.py | 8 ++++++-- src/calibre/library/server/opds.py | 8 +++++++- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 6d4f7a405f..a420cd7d44 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -43,17 +43,17 @@ author_sort_copy_method = 'invert' # Set which author field to display in the tags pane (the list of authors, # series, publishers etc on the left hand side). The choices are author and -# author_sort. This tweak affects only the tags pane, and only what is displayed -# under the authors category. Please note that if you set this to author_sort, -# it is very possible to see duplicate names in the list becasue although it is -# guaranteed that author names are unique, there is no such guarantee for -# author_sort values. Showing duplicates won't break anything, but it could -# lead to some confusion. When using 'author_sort', the tooltip will show the -# author's name. +# author_sort. This tweak affects only what is displayed under the authors +# category in the tags pane and content server. Please note that if you set this +# to author_sort, it is very possible to see duplicate names in the list because +# although it is guaranteed that author names are unique, there is no such +# guarantee for author_sort values. Showing duplicates won't break anything, but +# it could lead to some confusion. When using 'author_sort', the tooltip will +# show the author's name. # Examples: -# tags_pane_use_field_for_author_name = 'author' -# tags_pane_use_field_for_author_name = 'author_sort' -tags_pane_use_field_for_author_name = 'author' +# categories_use_field_for_author_name = 'author' +# categories_use_field_for_author_name = 'author_sort' +categories_use_field_for_author_name = 'author' # Set whether boolean custom columns are two- or three-valued. diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py index a0e26cf77c..478f6b042f 100644 --- a/src/calibre/gui2/tag_view.py +++ b/src/calibre/gui2/tag_view.py @@ -412,7 +412,7 @@ class TagTreeItem(object): # {{{ def tag_data(self, role): tag = self.tag if tag.category == 'authors' and \ - tweaks['tags_pane_use_field_for_author_name'] == 'author_sort': + tweaks['categories_use_field_for_author_name'] == 'author_sort': name = tag.sort tt_author = True else: diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 37f024c08d..b1c4a4c2f9 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -15,7 +15,7 @@ from calibre import isbytestring, force_unicode, fit_image, \ prepare_string_for_xml as xml from calibre.utils.ordered_dict import OrderedDict from calibre.utils.filenames import ascii_filename -from calibre.utils.config import prefs +from calibre.utils.config import prefs, tweaks from calibre.utils.icu import sort_key from calibre.utils.magick import Image from calibre.library.comments import comments_to_html @@ -151,7 +151,11 @@ def get_category_items(category, items, restriction, datatype, prefix): # {{{ '