diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index ecd52e68..eefd4a0e 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -177,6 +177,7 @@ class ConfigWidget(QWidget): prefs['includeimages'] = self.basic_tab.includeimages.isChecked() prefs['lookforurlinhtml'] = self.basic_tab.lookforurlinhtml.isChecked() prefs['checkforseriesurlid'] = self.basic_tab.checkforseriesurlid.isChecked() + prefs['checkforurlchange'] = self.basic_tab.checkforurlchange.isChecked() prefs['injectseries'] = self.basic_tab.injectseries.isChecked() prefs['smarten_punctuation'] = self.basic_tab.smarten_punctuation.isChecked() @@ -352,6 +353,11 @@ class BasicTab(QWidget): self.checkforseriesurlid.setChecked(prefs['checkforseriesurlid']) self.l.addWidget(self.checkforseriesurlid) + self.checkforurlchange = QCheckBox("Check for changed Story URL?",self) + self.checkforurlchange.setToolTip("Warn you if an update will change the URL of an existing book.") + self.checkforurlchange.setChecked(prefs['checkforurlchange']) + self.l.addWidget(self.checkforurlchange) + self.lookforurlinhtml = QCheckBox("Search EPUB text for Story URL?",self) self.lookforurlinhtml.setToolTip("Look for first valid story URL inside EPUB text if not found in metadata.\nSomewhat risky, could find wrong URL depending on EPUB content.\nAlso finds and corrects bad ffnet URLs from ficsaver.com files.") self.lookforurlinhtml.setChecked(prefs['lookforurlinhtml']) @@ -503,7 +509,7 @@ class PersonalIniTab(QWidget): self.ini = QTextEdit(self) try: self.ini.setFont(QFont("Courier", - self.plugin_action.gui.font().pointSize()+1)); + self.plugin_action.gui.font().pointSize()+1)) except Exception as e: print("Couldn't get font: %s"%e) self.ini.setLineWrapMode(QTextEdit.NoWrap) @@ -539,7 +545,7 @@ class ShowDefaultsIniDialog(QDialog): self.ini.setToolTip("These are all of the plugin's configurable options\nand their default settings.") try: self.ini.setFont(QFont("Courier", - get_gui().font().pointSize()+1)); + get_gui().font().pointSize()+1)) except Exception as e: print("Couldn't get font: %s"%e) self.ini.setLineWrapMode(QTextEdit.NoWrap) diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 43388079..fee62951 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -164,7 +164,7 @@ class DroppableQTextEdit(QTextEdit): def canInsertFromMimeData(self, source): if source.hasUrls(): - return True; + return True else: return QTextEdit.canInsertFromMimeData(self,source) @@ -208,7 +208,7 @@ class AddNewDialog(SizePersistedDialog): self.groupbox.setChecked(False) self.groupbox.setFlat(True) print("style:%s"%self.groupbox.styleSheet()) - self.groupbox.setStyleSheet(gpstyle); + self.groupbox.setStyleSheet(gpstyle) self.gbf = QFrame() self.gbl = QVBoxLayout() diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 174b7f8c..bba8ca72 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -628,7 +628,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): return if not id_list: - id_list = self.gui.library_view.get_selected_ids(); + id_list = self.gui.library_view.get_selected_ids() if len(id_list) == 0: self.gui.status_bar.show_message(_('No Selected Books to Update'), 3000) @@ -918,7 +918,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): if book_id and mi: # book_id and mi only set if matched by title/author. liburl = self.get_story_url(db,book_id) - if book['url'] != liburl: + if book['url'] != liburl and prefs['checkforurlchange']: if collision in (OVERWRITE,OVERWRITEALWAYS): updat="overwrit" else: @@ -1852,7 +1852,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): book['title'] = series for sr in serieslist: if series != sr: - book['title'] = deftitle; + book['title'] = deftitle break configuration = get_ffdl_config(book['url'],fileform) diff --git a/calibre-plugin/prefs.py b/calibre-plugin/prefs.py index 040ba90b..af7d2dae 100644 --- a/calibre-plugin/prefs.py +++ b/calibre-plugin/prefs.py @@ -40,6 +40,7 @@ default_prefs['adddialogstaysontop'] = False default_prefs['includeimages'] = False default_prefs['lookforurlinhtml'] = False default_prefs['checkforseriesurlid'] = True +default_prefs['checkforurlchange'] = True default_prefs['injectseries'] = False default_prefs['smarten_punctuation'] = False