Allow fetchart to manipulate cover art candidates using all selected options#5440
Allow fetchart to manipulate cover art candidates using all selected options#5440mlbaquerizo wants to merge 11 commits intobeetbox:masterfrom
Conversation
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@wisp3rwind I would love a set of eyes on this. I think its still relevant. Tagged you because you were part of some related conversations in related issues/PRs |
|
I've only now noticed this PR, apologies @mlbaquerizo. Are you happy to rebase it? |
hey @snejus thanks for taking a look! I'm in the process of rebasing now. Some tests have changed so I need to address that. Almost there though, just letting you know. |
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`
90d026a to
fce8dfe
Compare
|
Looks like i have some work to do. Feel free to close and I can reopen if/when I fix everything? Lots of changes and I haven't looked at this project in a while |
Yeah this makes sense, thanks! |
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_BADreturned, 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 returningTrueorFalse. I also interpretedCANDIDATE_EXACTto mean that no further checks are needed, so returned straight away in cases whereCANDIDATE_EXACTwas 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
convertfunctions behave the same way thatresize,convert_format, anddeinterlaceworked 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)