Modify explanation text in the image type selector

This commit is contained in:
twodoorcoupe
2024-07-10 13:45:59 +02:00
parent 17f5c61ae1
commit fba6441fc9
3 changed files with 14 additions and 6 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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