mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Optimization of composite column evaluation: don't compute the user_categories, as they cannot appear in a composite column.
This commit is contained in:
parent
f979f0d357
commit
3a2a3f1b4f
@ -191,7 +191,8 @@ class CacheRow(list): # {{{
|
||||
if is_comp:
|
||||
id = list.__getitem__(self, 0)
|
||||
self._must_do = False
|
||||
mi = self.db.get_metadata(id, index_is_id=True)
|
||||
mi = self.db.get_metadata(id, index_is_id=True,
|
||||
get_user_categories=False)
|
||||
for c in self._composites:
|
||||
self[c] = mi.get(self._composites[c])
|
||||
return list.__getitem__(self, col)
|
||||
|
@ -823,7 +823,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
pass
|
||||
return (path, mi, sequence)
|
||||
|
||||
def get_metadata(self, idx, index_is_id=False, get_cover=False):
|
||||
def get_metadata(self, idx, index_is_id=False, get_cover=False,
|
||||
get_user_categories=True):
|
||||
'''
|
||||
Convenience method to return metadata as a :class:`Metadata` object.
|
||||
Note that the list of formats is not verified.
|
||||
@ -882,6 +883,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
|
||||
user_cats = self.prefs['user_categories']
|
||||
user_cat_vals = {}
|
||||
if get_user_categories:
|
||||
for ucat in user_cats:
|
||||
res = []
|
||||
for name,cat,ign in user_cats[ucat]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user