Add tweak to display permit displaying series_sort for series in the tag browser.

This commit is contained in:
Charles Haley 2025-07-06 13:26:00 +01:00
parent 1ae5781cce
commit bb11deca05
2 changed files with 24 additions and 14 deletions

View File

@ -91,20 +91,24 @@ author_surname_prefixes = ('da', 'de', 'di', 'la', 'le', 'van', 'von')
# Default: r'(?i),?\s+(and|with)\s+'
authors_split_regex = r'(?i),?\s+(and|with)\s+'
#: Use author sort in Tag browser
# Set which author field to display in the Tag browser (the list of authors,
# series, publishers etc on the left hand side). The choices are author and
# author_sort. This tweak affects only what is displayed under the authors
# category in the Tag browser 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.
#: Use author_sort and/or series_sort for names in Tag browser
# Set which author or series field is used to display as the item name in the
# Tag browser (the list of authors, series, publishers etc on the left hand
# side). The choices for author are 'author' and 'author_sort'. The choices for
# series are 'series' and 'series_sort'. This tweak affects only what is
# displayed under the category in the Tag browser and Content server. Please
# note that if you set this to …_sort, it is possible to see duplicate names in
# the list because although it is guaranteed that author and series names are
# unique, there is no such guarantee for their sort values. Showing duplicates
# won't break anything but it could lead to some confusion. The tooltip for an
# item will show the item's name no matter how you set this tweak.
# Examples:
# categories_use_field_for_author_name = 'author'
# categories_use_field_for_author_name = 'author_sort'
# categories_use_field_for_series_name = 'series'
# categories_use_field_for_series_name = 'series_sort'
categories_use_field_for_author_name = 'author'
categories_use_field_for_series_name = 'series'
#: Control partitioning of Tag browser
# When partitioning the Tag browser, the format of the subcategory label is

View File

@ -96,11 +96,17 @@ def create_tag_class(category, fm):
is_editable = category not in {'news', 'rating', 'languages', 'formats',
'identifiers'} and dt != 'composite'
if (tweaks['categories_use_field_for_author_name'] == 'author_sort' and
(category == 'authors' or
if (
( category == 'authors' or
(cat['display'].get('is_names', False) and
cat['is_custom'] and cat['is_multiple'] and
dt == 'text'))):
cat['is_custom'] and cat['is_multiple'] and
dt == 'text') and
tweaks['categories_use_field_for_author_name'] == 'author_sort'
) or (
cat['datatype'] == 'series' and
tweaks['categories_use_field_for_series_name'] == 'series_sort'
)
):
use_sort_as_name = True
else:
use_sort_as_name = False