mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Device drivers: Add a prepare_addable_books API method
This commit is contained in:
parent
64f0f0fd9d
commit
b25724a8ea
@ -518,3 +518,9 @@ class BookList(list):
|
|||||||
'''
|
'''
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def prepare_addable_books(self, paths):
|
||||||
|
'''
|
||||||
|
Given a list of paths, returns another list of paths. These paths
|
||||||
|
point to addable versions of the books.
|
||||||
|
'''
|
||||||
|
return paths
|
||||||
|
@ -397,6 +397,7 @@ class AddAction(InterfaceAction):
|
|||||||
d = error_dialog(self.gui, _('Add to library'), _('No book files found'))
|
d = error_dialog(self.gui, _('Add to library'), _('No book files found'))
|
||||||
d.exec_()
|
d.exec_()
|
||||||
return
|
return
|
||||||
|
paths = self.gui.device_manager.device.prepare_addable_books(paths)
|
||||||
from calibre.gui2.add import Adder
|
from calibre.gui2.add import Adder
|
||||||
self.__adder_func = partial(self._add_from_device_adder, on_card=None,
|
self.__adder_func = partial(self._add_from_device_adder, on_card=None,
|
||||||
model=view.model())
|
model=view.model())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user