Exemple #1
0
 def process_epub_formats(self):
     '''
     Ask the user if they want to try to find homes for those books that already had an entry in calibre
     '''
     for book in self.duplicate_book_list:
         mi, tmp_file = book[0], book[1]
         dup_ids = self.db.find_identical_books(mi)
         home_id = self.find_a_home(dup_ids)
         if home_id is not None:
             # Found an epub-free duplicate to add the epub to.
             # build a list for the add_epub_format method to use.
             self.formats_to_add.append((home_id, mi, tmp_file))
         else:
             self.no_home_for_book.append(mi)
     # If we found homes for decrypted epubs in existing calibre entries, feed the list of decrypted book 
     # details and the callback function (self.add_epub_format) to the ProgressDialog dispatcher.
     if self.formats_to_add:
         d = AddEpubFormatsProgressDialog(self.gui, self.formats_to_add, self.add_epub_format)
         if d.wasCanceled():
             print (_('{} - "Insert formats" canceled by user.').format(PLUGIN_NAME + ' v' + PLUGIN_VERSION))
             self.add_formats_cancelled = True
             return
         #return
     return
Exemple #2
0
 def process_epub_formats(self):
     '''
     Ask the user if they want to try to find homes for those books that already had an entry in calibre
     '''
     for book in self.duplicate_book_list:
         mi, tmp_file = book[0], book[1]
         dup_ids = self.db.find_identical_books(mi)
         home_id = self.find_a_home(dup_ids)
         if home_id is not None:
             # Found an epub-free duplicate to add the epub to.
             # build a list for the add_epub_format method to use.
             self.formats_to_add.append((home_id, mi, tmp_file))
         else:
             self.no_home_for_book.append(mi)
     # If we found homes for decrypted epubs in existing calibre entries, feed the list of decrypted book 
     # details and the callback function (self.add_epub_format) to the ProgressDialog dispatcher.
     if self.formats_to_add:
         d = AddEpubFormatsProgressDialog(self.gui, self.formats_to_add, self.add_epub_format)
         if d.wasCanceled():
             print (_('{} - "Insert formats" canceled by user.').format(PLUGIN_NAME + ' v' + PLUGIN_VERSION))
             self.add_formats_cancelled = True
             return
         #return
     return