mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
More API
This commit is contained in:
parent
a57a355572
commit
70f338b047
@ -311,6 +311,12 @@ class LibraryDatabase(object):
|
|||||||
if notify:
|
if notify:
|
||||||
self.notify('delete', [id])
|
self.notify('delete', [id])
|
||||||
|
|
||||||
|
def dirtied(self, book_ids, commit=True):
|
||||||
|
self.new_api.mark_as_dirty(book_ids)
|
||||||
|
|
||||||
|
def dump_metadata(self, book_ids=None, remove_from_dirtied=True, commit=True, callback=None):
|
||||||
|
self.new_api.dump_metadata(book_ids=book_ids, remove_from_dirtied=remove_from_dirtied, callback=callback)
|
||||||
|
|
||||||
def authors_sort_strings(self, index, index_is_id=False):
|
def authors_sort_strings(self, index, 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)
|
||||||
return list(self.new_api.author_sort_strings_for_books((book_id,))[book_id])
|
return list(self.new_api.author_sort_strings_for_books((book_id,))[book_id])
|
||||||
|
@ -344,6 +344,7 @@ class LegacyTest(BaseTest):
|
|||||||
legacy.delete_book(1)
|
legacy.delete_book(1)
|
||||||
old.delete_book(1)
|
old.delete_book(1)
|
||||||
self.assertNotIn(1, legacy.all_ids())
|
self.assertNotIn(1, legacy.all_ids())
|
||||||
|
legacy.dump_metadata((2,3))
|
||||||
old.close()
|
old.close()
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user