Metadata download: Add an option to allow the user to choose whther to prefer smaller or larger tag sets

This commit is contained in:
Kovid Goyal 2011-04-21 21:13:23 -06:00
parent df383157a3
commit 920738995f
4 changed files with 22 additions and 9 deletions

View File

@ -25,6 +25,7 @@ msprefs.defaults['max_tags'] = 20
msprefs.defaults['wait_after_first_identify_result'] = 30 # seconds 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
# 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

@ -216,7 +216,7 @@ class ISBNMerge(object):
# We assume the smallest set of tags has the least cruft in it # We assume the smallest set of tags has the least cruft in it
ans.tags = self.length_merge('tags', results, ans.tags = self.length_merge('tags', results,
null_value=ans.tags) null_value=ans.tags, shortest=msprefs['fewer_tags'])
# We assume the longest series has the most info in it # We assume the longest series has the most info in it
ans.series = self.length_merge('series', results, ans.series = self.length_merge('series', results,

View File

@ -259,6 +259,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
r('wait_after_first_identify_result', msprefs) r('wait_after_first_identify_result', msprefs)
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)
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>300</height> <height>394</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="6"> <item row="0" column="0" rowspan="7">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Metadata sources</string> <string>Metadata sources</string>
@ -105,7 +105,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="4" 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>
@ -115,10 +115,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="4" column="2">
<widget class="QSpinBox" name="opt_max_tags"/> <widget class="QSpinBox" name="opt_max_tags"/>
</item> </item>
<item row="4" column="1"> <item row="5" 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>
@ -128,14 +128,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="5" 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="5" column="1"> <item row="6" 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>
@ -145,13 +145,24 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="6" 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">
<widget class="QCheckBox" name="opt_fewer_tags">
<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.
&lt;p&gt;Note that this option will only make a practical difference if one of the metadata sources has a genre like tag set for the book you are searching for. Most often, they all have large tag sets.</string>
</property>
<property name="text">
<string>Prefer &amp;fewer tags</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2"/> <widget class="QWidget" name="page_2"/>