Finishing the option of downloading cover in single metadata and correcting a bug concerning option saving

This commit is contained in:
Sengian 2010-10-30 18:11:50 +02:00
parent 02cf6bb1b3
commit c7995f136f
2 changed files with 10 additions and 0 deletions

View File

@ -123,6 +123,8 @@ def _config():
help=_('Download social metadata (tags/rating/etc.)'))
c.add_opt('overwrite_author_title_metadata', default=True,
help=_('Overwrite author and title with new metadata'))
c.add_opt('overwrite_cover_image', default=False,
help=_('Overwrite cover with new new cover if existing'))
c.add_opt('enforce_cpu_limit', default=True,
help=_('Limit max simultaneous jobs to number of CPUs'))
c.add_opt('tag_browser_hidden_categories', default=set(),

View File

@ -137,6 +137,7 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
self.fetch_metadata()
self.opt_get_social_metadata.setChecked(config['get_social_metadata'])
self.opt_overwrite_author_title_metadata.setChecked(config['overwrite_author_title_metadata'])
self.opt_overwrite_cover_image.setChecked(config['overwrite_cover_image'])
def show_summary(self, current, *args):
@ -219,6 +220,13 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
_hung_fetchers.add(self.fetcher)
if hasattr(self, '_hangcheck') and self._hangcheck.isActive():
self._hangcheck.stop()
#option configure
if self.opt_get_social_metadata.isChecked() != config['get_social_metadata']:
config.set('get_social_metadata', self.opt_get_social_metadata.isChecked())
if self.opt_overwrite_author_title_metadata.isChecked() != config['overwrite_author_title_metadata']:
config.set('overwrite_author_title_metadata', self.opt_overwrite_author_title_metadata.isChecked())
if self.opt_overwrite_cover_image.isChecked() != config['overwrite_cover_image']:
config.set('overwrite_cover_image', self.opt_overwrite_cover_image.isChecked())
def __enter__(self, *args):
return self