Metadata download: Add an option to turn off the use of the published date for the earliest edition a book as the published date

This commit is contained in:
Kovid Goyal 2012-10-06 13:02:50 +05:30
parent d8cd99e8b9
commit 7ea11f7c1c
4 changed files with 26 additions and 15 deletions

View File

@ -26,6 +26,7 @@ msprefs.defaults['wait_after_first_identify_result'] = 30 # seconds
msprefs.defaults['wait_after_first_cover_result'] = 60 # seconds msprefs.defaults['wait_after_first_cover_result'] = 60 # seconds
msprefs.defaults['swap_author_names'] = False msprefs.defaults['swap_author_names'] = False
msprefs.defaults['fewer_tags'] = True msprefs.defaults['fewer_tags'] = True
msprefs.defaults['find_first_edition_date'] = True
# Google covers are often poor quality (scans/errors) but they have high # Google covers are often poor quality (scans/errors) but they have high
# resolution, so they trump covers from better sources. So make sure they # resolution, so they trump covers from better sources. So make sure they

View File

@ -120,6 +120,8 @@ class ISBNMerge(object):
self.log.debug(xw.tb) self.log.debug(xw.tb)
else: else:
isbns, min_year = xw.isbns, xw.min_year isbns, min_year = xw.isbns, xw.min_year
if not msprefs['find_first_edition_date']:
min_year = None
if not isbns: if not isbns:
isbns = frozenset([isbn]) isbns = frozenset([isbn])
if isbns in self.pools: if isbns in self.pools:

View File

@ -296,6 +296,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
r('wait_after_first_cover_result', msprefs) r('wait_after_first_cover_result', msprefs)
r('swap_author_names', msprefs) r('swap_author_names', msprefs)
r('fewer_tags', msprefs) r('fewer_tags', msprefs)
r('find_first_edition_date', msprefs)
self.configure_plugin_button.clicked.connect(self.configure_plugin) self.configure_plugin_button.clicked.connect(self.configure_plugin)
self.sources_model = SourcesModel(self) self.sources_model = SourcesModel(self)

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>781</width> <width>781</width>
<height>394</height> <height>439</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -21,7 +21,7 @@
<widget class="QStackedWidget" name="stack"> <widget class="QStackedWidget" name="stack">
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="7"> <item row="0" column="0" rowspan="8">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Metadata sources</string> <string>Metadata sources</string>
@ -104,22 +104,22 @@
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QPushButton" name="select_default_button"> <widget class="QPushButton" name="select_default_button">
<property name="text">
<string>&amp;Select default</string>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Restore your own subset of checked fields that you define using the 'Set as default' button</string> <string>Restore your own subset of checked fields that you define using the 'Set as default' button</string>
</property> </property>
<property name="text">
<string>&amp;Select default</string>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QPushButton" name="set_as_default_button"> <widget class="QPushButton" name="set_as_default_button">
<property name="text">
<string>&amp;Set as default</string>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Store the currently checked fields as a default you can restore using the 'Select default' button</string> <string>Store the currently checked fields as a default you can restore using the 'Select default' button</string>
</property> </property>
<property name="text">
<string>&amp;Set as default</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -139,7 +139,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Max. number of &amp;tags to download:</string> <string>Max. number of &amp;tags to download:</string>
@ -149,10 +149,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="5" column="2">
<widget class="QSpinBox" name="opt_max_tags"/> <widget class="QSpinBox" name="opt_max_tags"/>
</item> </item>
<item row="5" column="1"> <item row="6" column="1">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Max. &amp;time to wait after first match is found:</string> <string>Max. &amp;time to wait after first match is found:</string>
@ -162,14 +162,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="6" column="2">
<widget class="QSpinBox" name="opt_wait_after_first_identify_result"> <widget class="QSpinBox" name="opt_wait_after_first_identify_result">
<property name="suffix"> <property name="suffix">
<string> secs</string> <string> secs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="7" column="1">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Max. time to wait after first &amp;cover is found:</string> <string>Max. time to wait after first &amp;cover is found:</string>
@ -179,14 +179,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2"> <item row="7" column="2">
<widget class="QSpinBox" name="opt_wait_after_first_cover_result"> <widget class="QSpinBox" name="opt_wait_after_first_cover_result">
<property name="suffix"> <property name="suffix">
<string> secs</string> <string> secs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="2"> <item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="opt_fewer_tags"> <widget class="QCheckBox" name="opt_fewer_tags">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Different metadata sources have different sets of tags for the same book. If this option is checked, then calibre will use the smaller tag sets. These tend to be more like genres, while the larger tag sets tend to describe the books content. <string>&lt;p&gt;Different metadata sources have different sets of tags for the same book. If this option is checked, then calibre will use the smaller tag sets. These tend to be more like genres, while the larger tag sets tend to describe the books content.
@ -197,6 +197,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="opt_find_first_edition_date">
<property name="text">
<string>Use published date of earliest &quot;edition&quot; (from worldcat.org)</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2"/> <widget class="QWidget" name="page_2"/>