Content server: Remove tweak for ignoring some top-level custom columns in legacy interfaces.

The server should not be configured using tweaks. And all modern
interfaces dont use this code path anyway.
This commit is contained in:
Kovid Goyal 2020-05-09 13:26:09 +05:30
parent 9dde36036f
commit 8c1de2a921
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 1 additions and 32 deletions

View File

@ -342,29 +342,6 @@ sony_collection_sorting_rules = []
# a book' are added when copying books to another library # a book' are added when copying books to another library
add_new_book_tags_when_importing_books = False add_new_book_tags_when_importing_books = False
#: Set custom metadata fields that the Content server will or will not display.
# Controls what fields are displayed when clicking the "Search" button in the
# browser to search your calibre library.
# content_server_will_display is a list of custom fields to be displayed.
# content_server_wont_display is a list of custom fields not to be displayed.
# wont_display has priority over will_display.
# The special value '*' means all custom fields. The value [] means no entries.
# Defaults:
# content_server_will_display = ['*']
# content_server_wont_display = []
#
# Examples:
#
# To display only the custom fields #mytags and #genre:
# content_server_will_display = ['#mytags', '#genre']
# content_server_wont_display = []
#
# To display all fields except #mycomments:
# content_server_will_display = ['*']
# content_server_wont_display['#mycomments']
content_server_will_display = ['*']
content_server_wont_display = []
#: Set the maximum number of sort 'levels' #: Set the maximum number of sort 'levels'
# Set the maximum number of sort 'levels' that calibre will use to resort the # Set the maximum number of sort 'levels' that calibre will use to resort the
# library after certain operations such as searches or device insertion. Each # library after certain operations such as searches or device insertion. Each

View File

@ -13,7 +13,6 @@ from operator import itemgetter
from calibre import prints from calibre import prints
from calibre.constants import iswindows, ispy3 from calibre.constants import iswindows, ispy3
from calibre.srv.errors import HTTPNotFound from calibre.srv.errors import HTTPNotFound
from calibre.utils.config_base import tweaks
from calibre.utils.localization import get_translator from calibre.utils.localization import get_translator
from calibre.utils.socket_inheritance import set_socket_inherit from calibre.utils.socket_inheritance import set_socket_inherit
from calibre.utils.logging import ThreadSafeLog from calibre.utils.logging import ThreadSafeLog
@ -298,14 +297,7 @@ class Cookie(SimpleCookie):
def custom_fields_to_display(db): def custom_fields_to_display(db):
ckeys = set(db.field_metadata.ignorable_field_keys()) return frozenset(db.field_metadata.ignorable_field_keys())
yes_fields = set(tweaks['content_server_will_display'])
no_fields = set(tweaks['content_server_wont_display'])
if '*' in yes_fields:
yes_fields = ckeys
if '*' in no_fields:
no_fields = ckeys
return frozenset(ckeys & (yes_fields - no_fields))
# Logging {{{ # Logging {{{