mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Some misc legacy API
This commit is contained in:
parent
a824208ea2
commit
a65f804243
@ -65,14 +65,13 @@ class LibraryDatabase(object):
|
|||||||
cache.init()
|
cache.init()
|
||||||
self.data = View(cache)
|
self.data = View(cache)
|
||||||
self.id = self.data.index_to_id
|
self.id = self.data.index_to_id
|
||||||
self.count = self.data.count
|
for x in ('get_property', 'count', 'refresh_ids', 'set_marked_ids',
|
||||||
|
'multisort', 'search', 'search_getting_ids'):
|
||||||
|
setattr(self, x, getattr(self.data, x))
|
||||||
|
|
||||||
self.get_property = self.data.get_property
|
self.is_case_sensitive = getattr(backend, 'is_case_sensitive', False)
|
||||||
|
|
||||||
self.last_update_check = self.last_modified()
|
self.last_update_check = self.last_modified()
|
||||||
self.refresh_ids = self.data.refresh_ids
|
|
||||||
self.set_marked_ids = self.data.set_marked_ids
|
|
||||||
self.is_case_sensitive = getattr(backend, 'is_case_sensitive', False)
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.backend.close()
|
self.backend.close()
|
||||||
@ -283,6 +282,9 @@ class LibraryDatabase(object):
|
|||||||
return list(self.new_api.get_ids_for_custom_book_data(name))
|
return list(self.new_api.get_ids_for_custom_book_data(name))
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
def sort(self, field, ascending, subsort=False):
|
||||||
|
self.multisort([(field, ascending)])
|
||||||
|
|
||||||
def get_field(self, index, key, default=None, index_is_id=False):
|
def get_field(self, index, key, default=None, index_is_id=False):
|
||||||
book_id = index if index_is_id else self.id(index)
|
book_id = index if index_is_id else self.id(index)
|
||||||
mi = self.new_api.get_metadata(book_id, get_cover=key == 'cover')
|
mi = self.new_api.get_metadata(book_id, get_cover=key == 'cover')
|
||||||
|
@ -359,7 +359,8 @@ class LegacyTest(BaseTest):
|
|||||||
'run_import_plugins', 'vacuum', 'set_path', 'row', 'row_factory', 'rows', 'rmtree', 'series_index_pat',
|
'run_import_plugins', 'vacuum', 'set_path', 'row', 'row_factory', 'rows', 'rmtree', 'series_index_pat',
|
||||||
'import_old_database', 'dirtied_lock', 'dirtied_cache', 'dirty_queue_length', 'dirty_books_referencing',
|
'import_old_database', 'dirtied_lock', 'dirtied_cache', 'dirty_queue_length', 'dirty_books_referencing',
|
||||||
'windows_check_if_files_in_use', 'get_metadata_for_dump', 'get_a_dirtied_book', 'dirtied_sequence',
|
'windows_check_if_files_in_use', 'get_metadata_for_dump', 'get_a_dirtied_book', 'dirtied_sequence',
|
||||||
'format_filename_cache', 'format_metadata_cache', 'filter', 'create_version1', 'normpath',
|
'format_filename_cache', 'format_metadata_cache', 'filter', 'create_version1', 'normpath', 'custom_data_adapters',
|
||||||
|
'custom_table_names', 'custom_columns_in_meta', 'custom_tables',
|
||||||
}
|
}
|
||||||
SKIP_ARGSPEC = {
|
SKIP_ARGSPEC = {
|
||||||
'__init__',
|
'__init__',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user