From 7eb859147c6873b7b0d753e458469771f4fa0cb1 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 6 Jul 2025 13:43:51 +0100 Subject: [PATCH] Fix parentheses problem exposed by the db tests --- src/calibre/db/categories.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/db/categories.py b/src/calibre/db/categories.py index 9f1d7e69d8..f2cc105810 100644 --- a/src/calibre/db/categories.py +++ b/src/calibre/db/categories.py @@ -97,11 +97,12 @@ def create_tag_class(category, fm): 'identifiers'} and dt != 'composite' if ( - ( category == 'authors' or + ( + ( category == 'authors' or (cat['display'].get('is_names', False) and cat['is_custom'] and cat['is_multiple'] and - dt == 'text') and - tweaks['categories_use_field_for_author_name'] == 'author_sort' + 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'