Summary
- This is a…
- [ ] Bug fix
- [x] Feature addition
- [ ] Refactoring
- [ ] Minor / simple change (like a typo)
- [ ] Other
- Describe this change in 1-2 sentences: This change provides the user with the option of excluding selected cover art types from downloading from CAA.
Problem
STYLE-980 has added a new cover art style "Raw / Unedited". Although beneficial for identifying and allowing better images for archival purposes, the images within this type are generally not suitable for tagging purposes. Picard currently allows the user to select the types of images to download from CAA, but does not provide the ability to exclude selected image types from being downloaded.
- JIRA ticket: PICARD-1273: Add an option to exclude new cover art type "Raw / Unedited"
Solution
This change adds new user settings to indicate whether selected image types should be excluded from downloads from CAA and the list of image types to be excluded, similar to the option to only include selected image types. Additional logic is applied to the list of images selected for download, and any images with a type intersecting the user's "exclusion" type list are removed from the download list.
Generally speaking, the current logic for determining whether to download an image is (where the image is downloaded when "types" evaluates to True):
if self.restrict_types:
# only keep enabled caa types
types = set(image["types"]).intersection(
set(self.caa_types))
else:
types = True
This change adds a further check for exclusion, as:
if self.restrict_types:
# only keep enabled caa types
types = set(image["types"]).intersection(
set(self.caa_types))
else:
types = True
if types and self.omit_types:
# omit selected caa types
types = not set(image["types"]).intersection(
set(self.caa_types_to_omit))
Action
Currently, it appears that CAA does not return the new "Raw/Unedited" type in the list of image types associated with an image. This is described (with an example) in CAA-113: CAA does not return "Raw/Unedited" in image type array. This will need to be addressed before the proposed changes will work.