diff --git a/picard/coverart/__init__.py b/picard/coverart/__init__.py index adc4e0d71..88f3eea1f 100644 --- a/picard/coverart/__init__.py +++ b/picard/coverart/__init__.py @@ -73,10 +73,10 @@ class CoverArt: else: log.debug("Cover art disabled by user options.") - def _set_metadata(self, coverartimage, data, info): + def _set_metadata(self, coverartimage, data, image_info): try: if coverartimage.can_be_processed: - run_image_processors(coverartimage, data, info) + run_image_processors(coverartimage, data, image_info) else: coverartimage.set_tags_data(data) if coverartimage.can_be_saved_to_metadata: @@ -119,12 +119,12 @@ class CoverArt: echo=None ) try: - info = imageinfo.identify(data) + image_info = imageinfo.identify(data) filters_result = True if coverartimage.can_be_filtered: - filters_result = run_image_filters(data, info, self.album, coverartimage) + filters_result = run_image_filters(data, image_info, self.album, coverartimage) if filters_result: - self._set_metadata(coverartimage, data, info) + self._set_metadata(coverartimage, data, image_info) except (CoverArtImageIOError, imageinfo.IdentificationError): # It doesn't make sense to store/download more images if we can't # save them in the temporary folder, abort. diff --git a/picard/ui/options/cover.py b/picard/ui/options/cover.py index 2e630283c..6951fce0b 100644 --- a/picard/ui/options/cover.py +++ b/picard/ui/options/cover.py @@ -144,10 +144,18 @@ class CoverOptionsPage(OptionsPage): self.ui.ca_providers_groupbox.setEnabled(files_enabled or tags_enabled) def select_never_replace_image_types(self): + instructions_bottom = N_( + "Embedded cover art images with a type found in the 'Include' list will never be replaced " + "by a newly downloaded image UNLESS they also have an image type in the 'Exclude' list. " + "Images with types found in the 'Exclude' list will always be replaced by downloaded images " + "of the same type. Images types not appearing in the 'Include' or 'Exclude' list will " + "not be considered when determining whether or not to replace an embedded cover art image.\n" + ) (included_types, excluded_types, ok) = CAATypesSelectorDialog.display( types_include=self.dont_replace_included_types, types_exclude=self.dont_replace_excluded_types, parent=self, + instructions_bottom=instructions_bottom, ) if ok: self.dont_replace_included_types = included_types diff --git a/picard/util/imagelist.py b/picard/util/imagelist.py index d0b3df7cb..2a8ec7317 100644 --- a/picard/util/imagelist.py +++ b/picard/util/imagelist.py @@ -110,5 +110,5 @@ class ImageList(MutableSequence): previous_image = types_dict[image_types] if image.width > previous_image.width or image.height > previous_image.height: continue - types_dict[image.normalized_types()] = image + types_dict[image_types] = image return types_dict