mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
b9f31eefee
commit
a90c68d8e9
@ -776,7 +776,7 @@ LibraryDatabase.format_hash = MT(lambda self, book_id, fmt:self.new_api.format_h
|
|||||||
LibraryDatabase.index = MT(lambda self, book_id, cache=False:self.data.id_to_index(book_id))
|
LibraryDatabase.index = MT(lambda self, book_id, cache=False:self.data.id_to_index(book_id))
|
||||||
LibraryDatabase.has_cover = MT(lambda self, book_id:self.new_api.field_for('cover', book_id))
|
LibraryDatabase.has_cover = MT(lambda self, book_id:self.new_api.field_for('cover', book_id))
|
||||||
LibraryDatabase.get_tags = MT(lambda self, book_id:set(self.new_api.field_for('tags', book_id)))
|
LibraryDatabase.get_tags = MT(lambda self, book_id:set(self.new_api.field_for('tags', book_id)))
|
||||||
LibraryDatabase.get_categories = MT(lambda self, sort='name', ids=None, icon_map=None:self.new_api.get_categories(sort=sort, book_ids=ids, icon_map=icon_map))
|
LibraryDatabase.get_categories = MT(lambda self, sort='name', ids=None:self.new_api.get_categories(sort=sort, book_ids=ids))
|
||||||
LibraryDatabase.get_identifiers = MT(
|
LibraryDatabase.get_identifiers = MT(
|
||||||
lambda self, index, index_is_id=False: self.new_api.field_for('identifiers', index if index_is_id else self.id(index)))
|
lambda self, index, index_is_id=False: self.new_api.field_for('identifiers', index if index_is_id else self.id(index)))
|
||||||
LibraryDatabase.isbn = MT(
|
LibraryDatabase.isbn = MT(
|
||||||
|
@ -1768,7 +1768,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
pass
|
pass
|
||||||
return new_cats
|
return new_cats
|
||||||
|
|
||||||
def get_categories(self, sort='name', ids=None, icon_map=None):
|
def get_categories(self, sort='name', ids=None):
|
||||||
#start = last = time.clock()
|
#start = last = time.clock()
|
||||||
if sort not in self.CATEGORY_SORTS:
|
if sort not in self.CATEGORY_SORTS:
|
||||||
raise ValueError('sort ' + sort + ' not a valid value')
|
raise ValueError('sort ' + sort + ' not a valid value')
|
||||||
@ -1954,7 +1954,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
|
|
||||||
# icon_map is not None if get_categories is to store an icon and
|
# icon_map is not None if get_categories is to store an icon and
|
||||||
# possibly a tooltip in the tag structure.
|
# possibly a tooltip in the tag structure.
|
||||||
icon = None
|
icon = icon_map = None
|
||||||
label = tb_cats.key_to_label(category)
|
label = tb_cats.key_to_label(category)
|
||||||
if icon_map:
|
if icon_map:
|
||||||
if not tb_cats.is_custom_field(category):
|
if not tb_cats.is_custom_field(category):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user