From 59d0040e64e9694ba76dfe3533e0e8f70f47fa7b Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 14 Mar 2012 16:51:41 -0500 Subject: [PATCH] Make 'Update Calibre Only' add a new book if no matching book found. --- calibre-plugin/ffdl_plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 95a28c9b..322758d1 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -506,8 +506,11 @@ make_firstimage_cover:true if len(identicalbooks) > 1: raise NotGoingToDownload("More than one identical book--can't tell which to update/overwrite.","minusminus.png") + ## changed: add new book when CALIBREONLY if none found. if collision == CALIBREONLY and not identicalbooks: - raise NotGoingToDownload("Not updating Calibre Metadata, no existing book to update.","search_delete_saved.png") + collision = ADDNEW + options['collision'] = ADDNEW + # raise NotGoingToDownload("Not updating Calibre Metadata, no existing book to update.","search_delete_saved.png") if len(identicalbooks)>0: book_id = identicalbooks.pop() @@ -515,7 +518,7 @@ make_firstimage_cover:true book['icon'] = 'edit-redo.png' if book_id != None and collision != ADDNEW: - if options['collision'] in (CALIBREONLY): + if collision in (CALIBREONLY): book['comment'] = 'Metadata collected.' # don't need temp file created below. return