Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fetchart to manipulate cover art candidates using all selected options #5440

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

mlbaquerizo
Copy link

Description

Fixes #4452.

Also, addresses conversations around candidate validation and refactoring ArtResizer to manipulate cover art in one go.
See #4133 (comment)

I felt that the cover art candidate validation was doing more than it should. In no instance where a candidate was considered for any manipulation was CANDIDATE_BAD returned, so I interpreted that as the candidate being valid. I adapted the work done in #4606 along with some of the feedback it received and used the pattern of returning True or False. I also interpreted CANDIDATE_EXACT to mean that no further checks are needed, so returned straight away in cases where CANDIDATE_EXACT was returned before.

Now, the Candidate convert method is responsible for determining if any manipulation is needed, puts all those options into one object, and passes them to ArtResizer.convert if manipulation is needed.

I tried to make the new convert functions behave the same way that resize, convert_format, and deinterlace worked while combining their functionality. Reviewers should double check this. The only difference is that I no longer explicitly deinterlace unless the deinterlace option is set.

To Do

  • Documentation (bugfix and refactor)
  • Changelog.
  • Tests.

This consolidates options passed to the fetchart plugin that would
require ImageMagick to adjust the cover art into a single function.
Candidate now returns False if Candidate is not valid and True if
it is. It is no longer concerned about any adjustments the plugin
needs to make to the Candidate.
The convert function will determine if the maxwidth, max_filesize,
cover_format, or deinterlace options should be applied and passes
all applicable options to ArtResizer's convert.
A test for cover format was also added to ensure that an image
can be converted from png to jpg with deinterlacing
These functions have been replaced by `convert`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fetchart cover_format does not seem to be working (PNG => JPEG)
1 participant