diff --git a/src/calibre/db/categories.py b/src/calibre/db/categories.py index 900f245b36..8d07714c3e 100644 --- a/src/calibre/db/categories.py +++ b/src/calibre/db/categories.py @@ -66,6 +66,7 @@ def find_categories(field_metadata): def create_tag_class(category, fm, icon_map): cat = fm[category] + dt = cat['datatype'] icon = None label = fm.key_to_label(category) if icon_map: @@ -76,13 +77,13 @@ def create_tag_class(category, fm, icon_map): icon = icon_map['custom:'] icon_map[category] = icon is_editable = category not in {'news', 'rating', 'languages', 'formats', - 'identifiers'} + 'identifiers'} and dt != 'composite' if (tweaks['categories_use_field_for_author_name'] == 'author_sort' and (category == 'authors' or (cat['display'].get('is_names', False) and cat['is_custom'] and cat['is_multiple'] and - cat['datatype'] == 'text'))): + dt == 'text'))): use_sort_as_name = True else: use_sort_as_name = False diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 754a583f74..d6362f2a76 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1932,7 +1932,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): use_sort_as_name = True else: use_sort_as_name = False - is_editable = category not in ['news', 'rating', 'languages'] + is_editable = (category not in ['news', 'rating', 'languages'] and + datatype != "composite") categories[category] = [tag_class(formatter(r.n), count=r.c, id=r.id, avg=avgr(r), sort=r.s, icon=icon, category=category,