'Add books from the local filesystem to either the library or the device.'

def add_books(self, *args):

    filters = get_filters()
    to_device = (self.gui.stack.currentIndex() != 0)
    if to_device:
        fmts = self.gui.device_manager.device.settings().format_map
        filters = [(_('Supported    books'), fmts)]
    books = choose_files(self.gui, 'add    books    dialog    dir', _('Select    books'), filters=filters)
    if (not books):
        return
    self._add_books(books, to_device)
