mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #1108017 (RuntimeError: maximum recursion depth exceeded)
This commit is contained in:
commit
015f3d48a7
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user