Enhance Sponsor Avatar and Logo Handling with Fallbacks #908
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.
Overview
This PR improves the visual consistency and reliability of sponsor displays by implementing fallback systems for both avatars and logos. It addresses cases where external logo URLs become inaccessible and ensures all sponsors have proper visual representation.
What Changed
Enhanced Avatar System
generate_avatar_url
method that creates dynamic avatars using ui-avatars.com APIavatar_image_path
to fallback to generated avatars when local images aren't availableRobust Logo URL Handling
logo_url_accessible?
method that checks if external logo URLs are actually reachableFuture enhancement
I was thinking that for the
logos_url
that are inaccessible, we could mark them someway (maybe with a boolean) as inaccessible in a way that the next time we the app go through thelogo_url_accessible?
can see that boolean and does not have to do a HTTP request to see if it is accessible.We would have to take into consideration if we implement that, that maybe the
logo_url
was momentarily inaccessible and then became accessible again, so periodically the app should try again to access thelogo_url
Even if we do not merge this PR, I would like to set the record that we should somehow manage inaccessible logo_url in the backend, not only in the views