[Old] Do not override feed featured image with ChatGPT image generation unless it is explicit. #882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
Even if you toggled the option
Generate only for missing images
, the ChatGPT job still ignored the option and just generated its images.This is mainly caused by a wonky logic on starting the generation.
Solution
Fixed the logic and refactored the code so that the names express the intention.
The new logic for image generation is like this:
Generate only for missing images
, only the generated image will be used.Others
I also changed the flow of image generation.
Previously, those were the steps:
The problem with this flow is that we decided to save the images after we generated them with ChatGPT. This is a waste of credits.
So I moved the step
5
after the step1
.When does ignoring might happen? This happens when you delete your previous import via
Purge & Reset
(without manually clearing the image imported in the Media Library) and import the same content.Testing
Found feeds with images (ensure the plugin can import from them #880 ). Example:
Add the ChatGPT integration into the Featured Image slot on Import Settings.
Generate only for missing images
is active, then original images from the feed will be kept and used as featured images. And any feed without an image will get a generated one.Note
Deleting the import with
Purge & Reset
does not remove the featured images saved in the Media Library and their association with the deleted posts.